Top 10 Practice Question Sets for OOP in Java – Exam Preparation Guide (2025)

Prepare effectively for your Object-Oriented Programming (OOP) Java exam with these 10 curated sets of model questions. Covers inheritance, multithreading, exception handling, GUI, JDBC, and more. Ideal for +2 CSIT, BCA, and Java learners.

Top 10 Practice Question Sets for OOP in Java – Exam Preparation Guide (2025)

Set 1

Group B – Attempt any SIX questions:

  1. What is polymorphism? Explain method overloading and overriding with examples.

  2. What is abstraction? Differentiate between abstract class and interface with example.

  3. Define static keyword. Write a program to show static variable, method, and block.

  4. Explain exception propagation. Write a program to illustrate use of throw and throws.

  5. What is the difference between ArrayList and LinkedList? Explain with example.

  6. Write short notes on (any two):
    i. JVM
    ii. Final keyword
    iii. Object class

Group C – Attempt any TWO questions:

  1. Write a Java GUI program using Swing to input two numbers and calculate their product and quotient using buttons. Display results in a dialog box.

  2. Write a Java program using threads: one thread prints numbers 1–100, another thread prints multiples of 5 from 1–100.

  3. Create a class Employee with fields id, name, salary. Create an array of 5 objects and display the employee with the highest salary.


Set 2

Group B – Attempt any SIX questions:

  1. What is inheritance? Explain different types of inheritance with Java examples.

  2. What are wrapper classes? Write a program to demonstrate use of Integer and Double wrapper classes.

  3. Differentiate between String and StringBuffer. Show with example.

  4. What is exception handling? Write a program using try, catch, finally.

  5. Define this keyword and explain its uses with program.

  6. Write short notes on (any two):
    i. Encapsulation
    ii. Java Collection Framework
    iii. Constructor overloading

Group C – Attempt any TWO questions:

  1. Write a Java program to create class Time with hours, minutes, seconds. Add methods to add and subtract two time objects and display them.

  2. Create a GUI program using AWT to find factorial when mouse is clicked and cube when mouse is released.

  3. Write a JDBC program to insert 5 records in Employee table and display records with salary > 50000.


Set 3

Group B – Attempt any SIX questions:

  1. What is encapsulation? How is it implemented in Java?

  2. Explain multithreading. How to create thread using Runnable and Thread class?

  3. What are access modifiers? List all with their scope.

  4. Differentiate between checked and unchecked exceptions. Give examples.

  5. What is final keyword in Java? Write a program to show its usage.

  6. Write short notes on (any two):
    i. JVM vs JRE vs JDK
    ii. Command line argument
    iii. Java Buzzwords

Group C – Attempt any TWO questions:

  1. Write a Java program using class Distance with feet and inches. Add and subtract two distance objects.

  2. Write a program to accept user data from a GUI form and save it into "student.txt" file only if checkbox is selected.

  3. Write a Java program using JDBC to connect Library database and display all books of category "Science".


Set 4

Group B – Attempt any SIX questions:

  1. Define arrays. How is a jagged array different from a 2D array? Give example.

  2. What is constructor? List types with examples.

  3. What is super keyword? How is it used in constructor chaining?

  4. Differentiate between == operator and equals() method.

  5. How is interface used to achieve multiple inheritance in Java?

  6. Write short notes on (any two):
    i. Internal Frames
    ii. Serialization
    iii. Use of valueOf() in wrapper classes

Group C – Attempt any TWO questions:

  1. Create class Student with roll, name, marks. Create array of 5 students and display topper.

  2. Write Java GUI using Swing to calculate Area and Perimeter of rectangle using TextFields and Buttons.

  3. JDBC program to update salary of employee where department is “HR”.


Set 5

Group B – Attempt any SIX questions:

  1. What is difference between Array and Collection in Java? Give example.

  2. How are exceptions handled in nested try-catch blocks? Write a sample program.

  3. What is method overriding? Demonstrate using a parent and child class.

  4. Explain life cycle of a thread with diagram.

  5. Differentiate between AWT and Swing.

  6. Write short notes on (any two):
    i. Garbage Collection
    ii. File Handling
    iii. Iterator and Comparator

Group C – Attempt any TWO questions:

  1. Write a GUI registration form with name, gender, DOB, and a checkbox. Store data to file if checkbox is checked.

  2. Create a class BankAccount with deposit, withdraw methods and balance field. Add proper validation and exception handling.

  3. Write a program that connects to a database Inventory, inserts product data and retrieves items with quantity < 5.


Let me know if you want answers or code samples for any question from the sets above.


Set 6

Group B – Attempt any SIX questions:

  1. What is interface in Java? How does it support multiple inheritance?

  2. What is method overloading? Give a program to demonstrate it.

  3. Explain difference between == and equals() for string comparison.

  4. What is thread synchronization? Why is it needed?

  5. Define the term Package in Java. How to create and use it?

  6. Write short notes on (any two):
    i. Bytecode
    ii. this vs super
    iii. Java memory model

Group C – Attempt any TWO questions:

  1. Create a class Complex with real and imaginary parts. Write methods to add, subtract and display complex numbers.

  2. Write a GUI program to input student name and marks in three subjects and display total and average using Swing.

  3. Write a JDBC program to connect to a Hospital database and list all patients admitted in ICU.


Set 7

Group B – Attempt any SIX questions:

  1. What is object-oriented programming? List and explain its main principles.

  2. Write a Java program to reverse a string without using built-in functions.

  3. Explain exception handling keywords with a sample program.

  4. What is the use of final class and method? Give an example.

  5. Describe the differences between interface and abstract class.

  6. Write short notes on (any two):
    i. StringBuilder class
    ii. instanceof operator
    iii. Java Applet

Group C – Attempt any TWO questions:

  1. Create a class Book with title, author, and price. Use array to store 5 books and display the one with highest price.

  2. Design a GUI calculator using Swing to perform +, –, *, / operations.

  3. Write a JDBC program to insert 5 products in a Product table and delete products with price below 100.

Set 8

Group B – Attempt any SIX questions:

  1. What are wrapper classes in Java? Write a program using Integer and Double.

  2. What is synchronization? How to create synchronized method and block?

  3. How does Java achieve platform independence? Explain with example.

  4. What is multilevel inheritance? Give a program to implement it.

  5. What is difference between Array and ArrayList?

  6. Write short notes on (any two):
    i. Java Tokens
    ii. String Pool
    iii. Constructors vs Methods

Group C – Attempt any TWO questions:

  1. Create a class Circle with radius and methods to calculate area and circumference. Create objects using constructors.

  2. Design a Java GUI application using checkbox and radio buttons to take survey on favorite food items and meal type.

  3. Write JDBC program to connect to School database and update student marks based on student ID.


Set 9

Group B – Attempt any SIX questions:

  1. What is the role of JVM in Java?

  2. Explain the concept of garbage collection in Java with example.

  3. What is constructor overloading? Illustrate with a class having multiple constructors.

  4. Define user-defined exceptions. Write a program that throws and catches a custom exception.

  5. How do we create threads using anonymous class?

  6. Write short notes on (any two):
    i. Use of volatile
    ii. String vs StringBuffer vs StringBuilder
    iii. Command Line Argument

Group C – Attempt any TWO questions:

  1. Write a class Student with name, roll, and an array of marks. Use methods to calculate total and average.

  2. Create a GUI program for login form using Swing. If username = “admin” and password = “1234”, display welcome message, else show error.

  3. Write JDBC program to connect to Bank database and retrieve accounts with balance more than 1 lakh.


Set 10

Group B – Attempt any SIX questions:

  1. What are inner classes in Java? Explain types with example.

  2. Define serialization. Write a program to serialize and deserialize a student object.

  3. How does try-with-resources work in Java? Give example with file handling.

  4. What is the use of transient keyword in Java?

  5. Explain use of Comparable and Comparator with examples.

  6. Write short notes on (any two):
    i. JavaBeans
    ii. Anonymous class
    iii. Difference between HashSet and TreeSet

Group C – Attempt any TWO questions:

  1. Create a class BankAccount with account number, name, and balance. Write methods to deposit, withdraw and show balance.

  2. Create a Swing form to register a user with name, email, password, and confirm password. Store data into file only if both passwords match.

  3. JDBC program to create Users table and insert 5 user records, then display all users with role “Admin”.