Objective Oriented Programming Question Bank
Objective Oriented Programming Question Bank
Section-A
1 Explain the difference between method overloading and method overriding.
2 Describe the role of Applet in Java.
3 How does Java handle exceptions using try and catch blocks?
4 What is the purpose of a constructor in Java?
5 Explain the difference between an Applet and a Swing application in Java.
6 What is constructor overloading? Provide a simple example.
7 What is an interface in Java, and how is it different from a class?
8 What are the key features of object-oriented programming in Java?
9 Briefly explain the concept of multithreading in Java.
10 How do access modifiers work in Java?
11 What is method overriding?
12 Define packages in Java and explain how to import them.
13 What is JVM, and explain its architecture?
14 What is the purpose of the synchronized keyword in multithreading?
15 What is an abstract class in Java, and when would you use it?
16 What is the difference between String Buffer and String Builder in Java?
17 What are the components of a Swing-based GUI application in Java?
18 What is the difference between throw and throws in exception handling?
19 Define a Java class and object with a simple example.
20 What is the difference between AWT and Swing in Java GUI programming?
Section-B
21 Discuss various types of control statements in Java.
Write a program in Java to create a simple calculator that takes two numbers as input and
22 performs addition, subtraction, multiplication, and division. Use command-line arguments for
input.
23 Explain the concept of the this keyword in Java with examples.
24 Discuss the significance of access modifiers in Java with examples.
Write a Java program to simulate a school management system that includes classes for
25 Student, Teacher, and Classroom. Include methods for assigning students to classes and
viewing the assigned students.
26 Discuss the memory management features in Java, focusing on garbage collection.
Create a Java program that reads input from a file, processes it, and writes the result to another
27 file. Use the BufferedReader and BufferedWriter classes to handle file I/O. The program
should convert all text in the file to uppercase before writing it to the output file.
28 Explain basic I/O operations in Java using the Scanner class.
29 Explain Java's naming conventions and their importance with suitable examples.
Write a Java program to simulate a simple banking system. The program should include classes
30 for BankAccount, Customer, and Transaction. Implement methods for depositing,
withdrawing, and viewing the account balance.
31 Explain the structure of a Java program with an example.
32 What are the different types of control flow statements in Java? Explain with examples.
Section-C
33 What is multiple inheritance? How can it be achieved in Java using interfaces?
Write a Java program to simulate a restaurant menu management system using abstract classes
34
and interfaces. Include options for adding items, removing items, and displaying the menu.
How is polymorphism implemented in Java? Provide examples of method overloading and
35
method overriding.
36 Differentiate between constructor overloading and method overloading with examples.
Create a Java program that demonstrates multiple inheritance using interfaces. Implement two
37 interfaces for Athlete and Student and create a class StudentAthlete that implements both
interfaces.
Explain the use of abstract classes in Java. Provide an example where an abstract class is
38
appropriate.
Create a Java program that uses interfaces to simulate a library system. The program should
have an interface LibraryItem with methods like checkOut, returnItem, and displayDetails.
39
Implement this interface in classes for Book and Magazine. Use polymorphism to handle the
items.
40 What is polymorphism in Java? Explain with a suitable program.
41 Describe the process of creating and using packages in Java. Provide examples.
Design a Java application to simulate an employee management system. Use inheritance where
the Employee class is the base class, and Manager and Engineer are derived classes. Include
42
methods for calculating the salary, and demonstrate method overriding for different salary
structures.
43 Explain the uses of the super keyword in Java.
44 Discuss the concept of dynamic method dispatch in Java.
Section-D
45 How are threads created in Java? Explain thread priorities.
Write a Java program that demonstrates the use of collections to store and manipulate student
46 records (name, ID, marks). Use a list to store the records and provide methods to add, remove,
and display student details.
47 What are checked and unchecked exceptions in Java? Provide examples.
48 What is deadlock in Java? How can it be prevented?
Write a Java program to simulate a ticket booking system with threads. Create a thread for
49
each booking window, and ensure that ticket availability is synchronized across all windows.
50 Explain the concept of thread synchronization in Java with examples.
Create a Java program to simulate an online shopping cart using the Java Collection
51 Framework. Implement classes for Product, ShoppingCart, and Order. Use a list to store items
in the cart and demonstrate adding, removing, and viewing products.
52 Discuss the hierarchy of exception classes in Java.
53 What is the role of wrapper classes in Java? Provide examples of autoboxing and unboxing.
Develop a Java application that demonstrates multithreading. The program should create two
54 threads: one thread to print odd numbers and another thread to print even numbers from 1 to
100. Ensure the two threads synchronize correctly to avoid race conditions.
55 What are the types of exceptions in Java? Explain with examples.
56 Discuss the difference between throw and throws in exception handling.
Section-E
57 What is event handling in Java? Explain with an example.
Write a Java program using JavaFX to create a simple form that allows users to input their
58
name, age, and address. Display the input in a new window once the submit button is clicked.
How do you handle files in Java? Write a program that demonstrates reading from and writing
59
to a file.
60 Discuss the life cycle of an Applet and its use cases.
Write a Java program to create a graphical login form using Swing. The form should include
61 fields for username and password and a submit button. Display a welcome message if the
correct username and password are entered.
62 Describe the life cycle of a Swing component in Java.
Develop a JavaFX application to simulate a simple traffic light system. The program should
63 have three buttons for the colours (red, yellow, green) and change the displayed colour in a
graphical window when a button is clicked.
64 Explain the MVC architecture used in Java Swing. Provide a simple example.
65 What are event listeners in Java? Explain the different types of event listeners used in Swing.
Write a Java program using Swing to create a basic calculator with a GUI. The Calculator
66 should support addition, subtraction, multiplication, and division operations, and display the
result on the screen.
67 Describe the components and containers in Swing.
68 What are JavaFX properties, and how are they used in GUI development? Provide examples.