Java QB
Java QB
Java QB
UNIT 1
1. Explain java language architecture with its components.
2. What is JVM? Explain its components.
3. Briefly explain the salient features in Java.
4. Write short note on Access Modifier
5. Explain static fields and methods of a class.
6. What are the types of classes in java?
7. What is Constructor Overloading/Method Overloading? Explain with the help of a
program
8. Write a short note on Garbage Collection in java.
9. Explain the meaning of following keywords which are associated with main method i)
public ii) Static iii) void iv) main() v) String args[]
10. Explain the terms: narrowing, widening , instantiation, autoboxing and unboxing.
11. List various Operators in Java and explain relational operators.
12. Discuss in detail the working of ‘foreach’ loop in Java.
13. Explain the working of switch..case with the help of example.
14. Write a program to create a class “Rectangle” which defines two methods one to
accept dimension of rectangle(i.e.legth and breadth) and another to calculate and
display the area of rectangle.
15. What is a constructor? Explain characteristics of constructor. Write a program to
demonstrate the concept of Constructor.
16. Explain the use for while loop?
17. Explain the structure of class in Java.
18. Write a java program to interchange values of two integers accepted from user.
Unit 2
1. Write a comparative note on abstract classes and interfaces in java.
2. Write a comparative note on overloading and overriding in java.
3. What is an inheritance? Explain multiple inheritance in java
4. Explain the terms/keywords : final , finally , finalize()
5. Explain the use of keywords super and this. What are the facts based on which base
class constructors will be called while creating derived class objects?
6. What is an interface? How is an interface different from a class?
7. Explain the concept of method overriding with the help of an example.
8. Write a program to implement the concept of multilevel inheritance.
9. Define an abstract class ‘Shape’ with an abstract method namely ‘CircleArea’ taking
one parameter that is its radius to compute area of a circle. Now create another class
‘Area’ containing a method ‘Circlearea’ for printing the area of circle. Create an
object of class ‘Area’ and test class ‘Area’.
10. What are the facts based on which base class constructor will be called while creating
derived class objects?
11. Explain the following keywords i) Extends ii) implements iii) finalize iv) final v)
import
12. Write a program to illustrate the concept of abstract method and abstract class
Unit 3
1. What is the purpose of a package? Explain the steps to create user define packages in
Java.
2. How do you create your own package and import it in a java program? Explain the
procedure stepwise using a suitable example.
3. Write in detail about the life cycle of a thread in java.
4. Explain exception handling mechanism in detail.
5. Can we handle multiple exceptions using a single catch block? Justify your answer
with an example.
6. Explain one dimensional array with example.
7. What are the different ways of creating a new Thread in Java?
8. Explain the purpose of the ‘try’, ‘catch’ and ‘finally’ blocks in exception handling
9. Differentiate between throw and throws keyword.
10. Provide an example of common run-time exception and explain how it can be caught
and handled?
11. Write an example to create thread implementing Runnable interface.
12. What is Synchronization? Explain wait (), notify (), notify All() methods.
13. Write a program to demonstrate use of any 5 String class methods.
14. Write a short note on String class. Explain any 5 methods of String Class.
15. Write a program to demonstrate use of any 5 Array class methods.
Unit 4
1. What is a Layout manager? Explain any two layouts.
2. What is the role of layout manager? What is the default layout of frame? Explain its
working.
3. Develop a frame that has three radio buttons Red, Green, Blue. On Click of any one
of them background color of the label should change accordingly.
4. Explain any two overloaded constructors and tow methods of class
JTextField/JLabel/JTextArea.
5. What is the role of layout manager? What is the default layout of frame? Explain its
working.
6. Create a Swing application to create a frame with a Button named “factorial”, a Label
and a TextField. Enter a number in the TextField. Click of the Button should display
factorial of that number on the Label.
7. What is the use of adapter classes? Explain any one Adapter class in detail.
8. Explain Jcheckbox and JRadioButton class along with its constructors and methods
in detail.
9. What is Menu? How to create a simple menu bar?
10. What is Panel? Explain JPanel with example.
11. Explain three parts of Delegation Event Model.
12. Explain any five event classes in detail.
13. Write short note on Event Listener Classes.
14. Write a Java Swing Program that uses BorderLayout to arrange five buttons in
different regions (North, South, East, West, Centre)
15. Write a Java Swing Program that uses GridLayout to arrange six buttons in a 2x3 grid.
regions (North, South, East, West, Centre)
16. What is FlowLayout in Java Swing? Provide a brief explanation.
UNIT 5