JAVA IMP
JAVA IMP
i) min()
ii) sqrt()
i) Class
ii) Object
b) Define constructor.
Unit - IV: Event handling using Abstract Window Toolkit (AWT) &
Swing Components
f) Give the syntax of <param> tag to pass parameters to an
applet.
i) notify()
ii) sleep()
8.
9. Describe interface in java with suitable example.
10. Describe interface in java with suitable example.
6 MARKS
Unit - I: Basic Syntactical Constructs in Java
1. Explain the concept of Dynamic method dispatch with a
suitable example.
2. Explain the command line arguments with a suitable example.
3. Describe the applet life cycle in detail.
4. Write a program to create a vector with five elements as (5,
15, 25, 35, 45). Insert a new element at the 2nd position.
Remove 1st and 4th element from the vector.
5. Write a Java program to count the number of words from a text
file using stream classes.
6. Explain the difference between string class and string buffer
class. Explain any four methods of string class.
7. Write a program to copy all elements of one array into another
array.
8. Write a program to print even and odd numbers using two
threads with a delay of 1000ms after each number.
9. Write a program that throws an exception called
“NoMatchException” when a string is not equal to “India”.
10. Write a Java applet to draw a bar chart for the following
values.
11. Write a Java program to define class Employee with
members as id and salary. Accept data for five employees and
display details of employees getting highest salary.
12. Write a program to design an Applet showing three
concentric circles filled with three different colors.
Unit - IV: Event Handling using Abstract Window Toolkit (AWT) &
Swing Components
1. Explain the concept of argument passing and the usage of the
'this' keyword in Java. Give an example to illustrate their usage
and benefits.
2. Write a program to create two threads: one thread will print
even numbers between 1 to 50, and the other will print odd
numbers between 1 to 50.
3. Write a program to design an Applet showing three concentric
circles filled with three different colors.
4. Write a program to draw a chessboard in Java Applet.
5. Write a Java applet to draw a bar chart for the following
values.