Organized Java Question Bank (Updated)
1. Core Java Concepts
- What is Object-Oriented Programming and explain the characteristics of OOPs?
- What is inheritance and explain the types of inheritance.
- What is method overloading? Explain using example.
- What is method overriding? Write a program using inheritance.
- Explain the concept of abstraction. How do access modifiers like private, public, default, and
protected help achieve abstraction?
- What is interface and why does it support multiple inheritance?
- Difference between Abstract class and Interface.
- What is the use of wrapper class in collection framework?
- What is this keyword? Write a program to demonstrate the use of this keyword.
- What is the use of super keyword? Explain using example.
- Compare AWT and Swing.
2. Java Keywords and Modifiers
- What is the static keyword and explain its uses.
- What is the use of final and throws keywords.
- Write the use of static variable with example.
- Write the use of final variable with example.
3. Exception Handling
- What is exception handling and how do you handle exceptions?
- Describe multiple catch blocks and their significance.
- Discuss the role of finally block in exception handling.
- Describe the types of exceptions in Java.
- Write a program to create DataNotFoundException and generate it when an element is not found
in an array.
4. Threads and Synchronization
- What is synchronization and why is it needed? Write a program to demonstrate synchronization.
- Discuss thread lifecycle with a diagram.
- How does Java handle thread priorities?
5. File Handling and Serialization
- Write a program to read and write a file in Java.
- What is Serialization? Write a program to demonstrate it.
6. Java Basics and Syntax
- What is datatype? Explain the types of datatypes in Java.
- What is a variable? Describe types based on purpose.
- What is an identifier and what are the rules for identifiers?
- Write the naming convention followed in Java.
7. Constructors and Classes
- Describe the types and uses of constructors.
- Design a Student class with private attributes, validation in setters for name, rollNumber, and
marks.
- Design a Person class with private attributes, validation in setters for name, address, age, and
income.
8. Java Programs
- Write a program to demonstrate use of this and super keywords.
- Write a program to check if a string is a palindrome.
- Write a program to find the smallest of 3 numbers.
- Write a program to find the sum of all palindrome numbers between 10 and 100.
- Write a program to calculate the average of student marks using private method and display
method.
- Write a program for matrix subtraction.
- Write a program to enter 10 numbers and display the sum of prime numbers.
- Write a program to find unique characters and their frequency in a string.
- Write a program to add values in a Map and display.
9. JDBC Programs
- Write a JDBC program to retrieve a single student info based on ID (id, name, mobile,
father_name, marks).
- Write a JDBC program to retrieve all staff info from the staff table where salary > 25000.
10. AWT and Swing GUI
- Describe AWT containers and components.
- What is the use of Layout Manager in Swing? Explain any two layouts.
- What is the use of adaptor class?
- Write a Swing program to perform arithmetic operations (add, sub, mul, div, mod) with 2 text fields,
label for result, 4 buttons.
- Add field validation: only numbers allowed.
- Add operational logic with button click event.
- Write a Swing program to design a registration form with 2 fields (name - only chars, mobile - 10
digits). Add validation on lost focus.
- Design a frame with all above components.
11. RMI and Networking
- Explain the architecture of RMI.
- Describe client-server architecture.
- How does Java support socket programming?
12. Packaging and Wrapper
- What is the use of package and import statement?
- What is wrapper class and its uses?
- What is auto-boxing and auto-unboxing?
13. Event Handling
- How is event handling implemented in AWT?
Additional Java Concepts and Notes
- Arithmetic operators
- List vs Set
- Serialization
- Deadlock
- Event handling
- Stub and Skeleton
- final
- throw and throws
- Thread priorities
- Statement
- switch
- encapsulation
- synchronization
- Daemon threads
- RMI architecture
- ArrayList
- HashMap
- Map
- Set
- Write a short note on the Java Virtual Machine (JVM).
- Write a short note on data types in Java.
- Write a short note on Java's platform independence.
- Write a short note on conditional statements in Java
- FileReader and FileWriter