0% found this document useful (0 votes)
2 views5 pages

Java-lab-qn

The document outlines various Java programming tasks including generating prime numbers, performing string manipulations, implementing multi-threading applications, handling exceptions, and creating graphical user interfaces. It covers a range of functionalities such as file handling, random number generation, and simulating a traffic light system. Each task emphasizes different Java concepts and techniques for building interactive applications.

Uploaded by

sankaransvg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Java-lab-qn

The document outlines various Java programming tasks including generating prime numbers, performing string manipulations, implementing multi-threading applications, handling exceptions, and creating graphical user interfaces. It covers a range of functionalities such as file handling, random number generation, and simulating a traffic light system. Each task emphasizes different Java concepts and techniques for building interactive applications.

Uploaded by

sankaransvg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Write a Java program that prompts the user for an integer and then prints out all the prime
numbers up to that Integer.

2. Write a program to do String Manipulation using CharacterArray and perform the following
string operations:
a. String length
b. Finding a character at a particular position
c. Concatenating two strings

1. Write a Java program that displays the number of characters, lines and words in a text

2. Write a java program that implements a multi-thread application that has three threads. First
thread check the given number is either even or odd, second thread computes the square of
the number and prints. Third thread will print the value of cube of the number.

1. Generate random numbers using Random class and print messages according to the range of
the value generated.
2. Write a program to perform the following string operations using String class:
a. String Concatenation
b. Search a substring
c. To extract substring from given string
1. Wite a program to demonstrate the use of following exceptions.
a. Arithmetic Exception
b. Number Format Exception
2. Write a program to accept a text and change its size and font. Include bold italic options. Use
frames and controls.

1. Write a Java program that reads on file name from the user, then displays information
about whether the file exists, whether the file is readable, whether the file is writable, the
type of file and the length of the file in bytes.
2. Write a Java program to multiply two given matrices.

1. Write a multi threading program which uses the asynchronous method and Runnable
interface to print the numbers 1to10 using Thread1 and to print 90 to100 using Thread2.
2. Write a Java program that handles all mouse events and shows the event name at the
center of the window when a mouse event is fired. (Use adapter classes).

1. Write a program to perform string operations using String Buffer class:


a. Length of a string
b. Reverse a string
c. Delete a substring from the given string
2. Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons
and do the +, -,*, % operations. Add a text field to display the result.
1. Write a multi threading program which uses the asynchronous method and Runnable
interface to print the numbers 1to10 using Thread1 and to print 90 to100 using Thread2.
2. Write a Java program that simulates a traffic light. The program lets the user select one of
three lights: red, yellow, or green with radio buttons. On selecting a button, an appropriate
message with “stop” or “ready” or “go” should appear above the buttons in a selected color.

1. Write a Java program that displays the number of characters, lines and words in a text

2. Write a Java program that handles all mouse events and shows the event name at the
center of the window when a mouse event is fired. (Use adapter classes).

1. Write a program to perform string operations using String Buffer class:


a. Length of a string
b. Reverse a string
c. Delete a substring from the given string
2. Write a Java program to multiply two given matrices.

1. Wite a program to demonstrate the use of following exceptions.


a. Arithmetic Exception
b. Number Format Exception
2. Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons
and do the +, -,*, % operations. Add a text field to display the result.
1. Generate random numbers using Random class and print messages according to the range of
the value generated.
2. Write a program to do String Manipulation using CharacterArray and perform the following
string operations:
a. String length
b. Finding a character at a particular position
c. Concatenating two strings

1. Write a Java program that reads on file name from the user, then displays information
about whether the file exists, whether the file is readable, whether the file is writable, the
type of file and the length of the file in bytes.
2. Write a Java program that simulates a traffic light. The program lets the user select
one of three lights: red, yellow, or green with radio buttons. On selecting a button, an
appropriate message with “stop” or “ready” or “go” should appear above the buttons in a
selected color.

1. Write a multi threading program which uses the asynchronous method and Runnable
interface to print the numbers 1to10 using Thread1 and to print 90 to100 using Thread2.
2. Write a program to accept a text and change its size and font. Include bold italic
options. Use frames and controls.

1. Wite a program to demonstrate the use of following exceptions.


a. Arithmetic Exception
b. Number Format Exception
2. Write a program to do String Manipulation using CharacterArray and perform the following
string operations:
a. String length
b. Finding a character at a particular position
c. Concatenating two strings
1. Write a program to perform string operations using String Buffer class:
a. Length of a string
b. Reverse a string
c. Delete a substring from the given string
2. Write a Java program that handles all mouse events and shows the event name at the
center of the window when a mouse event is fired. (Use adapter classes).

1. Write a Java program that displays the number of characters, lines and words in a text

2. Write a java program that implements a multi-thread application that has three threads. First
thread check the given number is either even or odd, second thread computes the square of
the number and prints. Third thread will print the value of cube of the number.

You might also like