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.

Set 1
Group B – Attempt any SIX questions:
-
What is polymorphism? Explain method overloading and overriding with examples.
-
What is abstraction? Differentiate between abstract class and interface with example.
-
Define static keyword. Write a program to show static variable, method, and block.
-
Explain exception propagation. Write a program to illustrate use of
throw
andthrows
. -
What is the difference between ArrayList and LinkedList? Explain with example.
-
Write short notes on (any two):
i. JVM
ii. Final keyword
iii. Object class
Group C – Attempt any TWO questions:
-
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.
-
Write a Java program using threads: one thread prints numbers 1–100, another thread prints multiples of 5 from 1–100.
-
Create a class
Employee
with fieldsid
,name
,salary
. Create an array of 5 objects and display the employee with the highest salary.
Set 2
Group B – Attempt any SIX questions:
-
What is inheritance? Explain different types of inheritance with Java examples.
-
What are wrapper classes? Write a program to demonstrate use of
Integer
andDouble
wrapper classes. -
Differentiate between
String
andStringBuffer
. Show with example. -
What is exception handling? Write a program using
try
,catch
,finally
. -
Define
this
keyword and explain its uses with program. -
Write short notes on (any two):
i. Encapsulation
ii. Java Collection Framework
iii. Constructor overloading
Group C – Attempt any TWO questions:
-
Write a Java program to create class
Time
with hours, minutes, seconds. Add methods to add and subtract two time objects and display them. -
Create a GUI program using AWT to find factorial when mouse is clicked and cube when mouse is released.
-
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:
-
What is encapsulation? How is it implemented in Java?
-
Explain multithreading. How to create thread using
Runnable
andThread
class? -
What are access modifiers? List all with their scope.
-
Differentiate between checked and unchecked exceptions. Give examples.
-
What is
final
keyword in Java? Write a program to show its usage. -
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:
-
Write a Java program using class
Distance
with feet and inches. Add and subtract two distance objects. -
Write a program to accept user data from a GUI form and save it into "student.txt" file only if checkbox is selected.
-
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:
-
Define arrays. How is a jagged array different from a 2D array? Give example.
-
What is constructor? List types with examples.
-
What is
super
keyword? How is it used in constructor chaining? -
Differentiate between
==
operator andequals()
method. -
How is interface used to achieve multiple inheritance in Java?
-
Write short notes on (any two):
i. Internal Frames
ii. Serialization
iii. Use ofvalueOf()
in wrapper classes
Group C – Attempt any TWO questions:
-
Create class
Student
with roll, name, marks. Create array of 5 students and display topper. -
Write Java GUI using Swing to calculate Area and Perimeter of rectangle using TextFields and Buttons.
-
JDBC program to update salary of employee where department is “HR”.
Set 5
Group B – Attempt any SIX questions:
-
What is difference between Array and Collection in Java? Give example.
-
How are exceptions handled in nested try-catch blocks? Write a sample program.
-
What is method overriding? Demonstrate using a parent and child class.
-
Explain life cycle of a thread with diagram.
-
Differentiate between AWT and Swing.
-
Write short notes on (any two):
i. Garbage Collection
ii. File Handling
iii. Iterator and Comparator
Group C – Attempt any TWO questions:
-
Write a GUI registration form with name, gender, DOB, and a checkbox. Store data to file if checkbox is checked.
-
Create a class
BankAccount
with deposit, withdraw methods and balance field. Add proper validation and exception handling. -
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:
-
What is interface in Java? How does it support multiple inheritance?
-
What is method overloading? Give a program to demonstrate it.
-
Explain difference between
==
andequals()
for string comparison. -
What is thread synchronization? Why is it needed?
-
Define the term Package in Java. How to create and use it?
-
Write short notes on (any two):
i. Bytecode
ii.this
vssuper
iii. Java memory model
Group C – Attempt any TWO questions:
-
Create a class
Complex
with real and imaginary parts. Write methods to add, subtract and display complex numbers. -
Write a GUI program to input student name and marks in three subjects and display total and average using Swing.
-
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:
-
What is object-oriented programming? List and explain its main principles.
-
Write a Java program to reverse a string without using built-in functions.
-
Explain exception handling keywords with a sample program.
-
What is the use of
final
class and method? Give an example. -
Describe the differences between interface and abstract class.
-
Write short notes on (any two):
i.StringBuilder
class
ii.instanceof
operator
iii. Java Applet
Group C – Attempt any TWO questions:
-
Create a class
Book
with title, author, and price. Use array to store 5 books and display the one with highest price. -
Design a GUI calculator using Swing to perform +, –, *, / operations.
-
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:
-
What are wrapper classes in Java? Write a program using
Integer
andDouble
. -
What is synchronization? How to create synchronized method and block?
-
How does Java achieve platform independence? Explain with example.
-
What is multilevel inheritance? Give a program to implement it.
-
What is difference between
Array
andArrayList
? -
Write short notes on (any two):
i. Java Tokens
ii. String Pool
iii. Constructors vs Methods
Group C – Attempt any TWO questions:
-
Create a class
Circle
with radius and methods to calculate area and circumference. Create objects using constructors. -
Design a Java GUI application using checkbox and radio buttons to take survey on favorite food items and meal type.
-
Write JDBC program to connect to
School
database and update student marks based on student ID.
Set 9
Group B – Attempt any SIX questions:
-
What is the role of JVM in Java?
-
Explain the concept of garbage collection in Java with example.
-
What is constructor overloading? Illustrate with a class having multiple constructors.
-
Define user-defined exceptions. Write a program that throws and catches a custom exception.
-
How do we create threads using anonymous class?
-
Write short notes on (any two):
i. Use ofvolatile
ii. String vs StringBuffer vs StringBuilder
iii. Command Line Argument
Group C – Attempt any TWO questions:
-
Write a class
Student
with name, roll, and an array of marks. Use methods to calculate total and average. -
Create a GUI program for login form using Swing. If username = “admin” and password = “1234”, display welcome message, else show error.
-
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:
-
What are inner classes in Java? Explain types with example.
-
Define serialization. Write a program to serialize and deserialize a student object.
-
How does
try-with-resources
work in Java? Give example with file handling. -
What is the use of
transient
keyword in Java? -
Explain use of
Comparable
andComparator
with examples. -
Write short notes on (any two):
i. JavaBeans
ii. Anonymous class
iii. Difference betweenHashSet
andTreeSet
Group C – Attempt any TWO questions:
-
Create a class
BankAccount
with account number, name, and balance. Write methods to deposit, withdraw and show balance. -
Create a Swing form to register a user with name, email, password, and confirm password. Store data into file only if both passwords match.
-
JDBC program to create
Users
table and insert 5 user records, then display all users with role “Admin”.
Tags:
- java oop practice questions
- java exam questions 2025
- object oriented programming java
- java question sets
- java model questions
- java mcq and subjective
- inheritance in java
- java multithreading questions
- java gui swing practice
- java file handling
- java jdbc questions
- +2 csit java questions
- java interview preparation
- java sample paper
- java board exam preparation