KEMBAR78
List of Java Questions For Reference | PDF | Method (Computer Programming) | Class (Computer Programming)
0% found this document useful (0 votes)
7 views4 pages

List of Java Questions For Reference

List of Java important questions

Uploaded by

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

List of Java Questions For Reference

List of Java important questions

Uploaded by

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

Module 1 – Basics of Java and Classes

1. Explain the features of Java that make it platform independent and secure.
2. With an example, explain constructor overloading in Java.
3. Write a program to demonstrate the use of this keyword.
4. Explain method overloading with suitable examples.
5. Write a program that accepts command line arguments and displays the
sum of integers passed.
6. Discuss garbage collection in Java with example.
7. Explain type conversion and casting in arrays with example
8. Explain single-dimensional and multi-dimensional arrays in Java with
examples.
9. Write a Java program to demonstrate the use of static variables and static
methods.
10.Explain the different types of variables in Java (instance, local, static)
with suitable examples.
11.Define the final keyword in Java. Explain its usage with respect to
variables, methods, and classes with suitable examples.
12.Explain with an example how an object can be passed as an argument to a
method in Java.
13.Explain the structure of a Java program with an example of class and
object.
14.Explain how objects are created in Java. Illustrate with a program.
15.Write a Java program to create a class Car with data members brand,
model, and price. Create objects and display their values.
16.Explain all four types of access specifiers in Java with suitable examples.

Module 2 – Inheritance, Strings, Generics


1. Explain dynamic method dispatch with an example program.
2. Explain the different types of inheritance with examples. Why does Java
not support multiple inheritance using classes?
3. Write a Java program to show how constructors are called in an
inheritance hierarchy.
4. Differentiate between abstract classes and inheritance with suitable
examples.
5. Write a program to demonstrate multiple inheritance using interfaces in
Java.
6. Explain all types of inheritance with suitable examples.
7. Differentiate between method overriding and method overloading with
examples.
8. Write a Java program to demonstrate the use of super keyword in
inheritance.
9. What are abstract classes? Explain with an example.
10.Explain String, StringBuffer, and StringBuilder with examples.
11.Explain generics in Java with an example of a generic class.
12.Explain with examples how different access specifiers affect inheritance
in Java.

Module 3 – Packages, Interfaces, Exceptions


1. What are packages? Write the steps and code to create and import a user-
defined package.
2. Write a Java program to create a package shapes with a class Circle.
Import and use it in another program.
3. Explain the concept of interfaces in Java with a program that implements
multiple interfaces.
4. Explain interfaces in Java. Write a program implementing multiple
interfaces.
5. Explain Java’s exception handling mechanism with the keywords: try,
catch, throw, throws, finally.
6. Write a Java program that demonstrates multiple catch blocks.
7. Write a Java program to demonstrate a nested try block
8. Write a program to create and use a user-defined exception. (Eg:Queue
Program)
9. Write a Java program to demonstrate default and static methods in
interfaces.
10.Explain exception handling in Java with the try-catch-finally construct
and example.
11.Differentiate between checked and unchecked exceptions with examples.
12.Write a program to create and use a user-defined exception.
13.Differentiate between built-in exceptions and user-defined exceptions
with examples.

Module 4 – Multithreading and I/O


1. Explain different ways of creating a thread in Java with example.
2. Explain the life cycle of a thread with a neat diagram.
3. Write a Java program to create multiple threads using the Thread class.
4. Write a program to demonstrate inter-thread communication using wait()
and notify().
5. Explain the significance of thread priorities with example.
6. What is synchronization? Explain with a synchronized method example.
7. Explain Java I/O byte streams with a program to copy contents of one file
to another.
8. Write a program to demonstrate reading and writing a text file using
FileReader and FileWriter.
9. Explain synchronization in multithreading with a program.
10.Write a Java program to demonstrate use of isAlive() and join().
Module 5 – Event Handling and AWT
1. Explain the Delegation Event Model with an example.
2. Write a program to demonstrate mouse event handling in Java using
MouseListener.
3. Write a Java program to handle both mouse and keyboard events in AWT.
4. Explain the AWT hierarchy and fundamental classes with diagram.
5. Explain the hierarchy of event classes and event listener interfaces with
examples
6. Write a Java program to create a simple frame window with buttons using
AWT.
7. Write a Java program to create a frame window with buttons using AWT.
8. Explain different types of event listener interfaces in Java.
9. Write a program to handle both mouse and keyboard events in AWT.
10.Write a Java program to demonstrate the use of MouseMotionListener.
11.Write a Java program to create a simple frame window with buttons using
AWT.
12.Discuss the advantages and limitations of using AWT for GUI
development
13.Explain how to register an event listener in Java

You might also like