1.) What is the primary goal of Object-Oriented Programming (OOP)?
A) Improving code readability
B) Maximizing memory usage
C) Enhancing network connectivity
D) Promoting code duplication
Answer: Option A
2.) What is an object in Java?
A) A blueprint for creating classes
B) A template for creating methods
C) An instance of a class with its own state and behavior
D) A reserved keyword in Java
Answer: Option C
3.) Which concept allows you to define multiple methods in OOP with the same name but different parameters in the same class?
A) Polymorphism
B) Inheritance
C) Abstraction
D) Overloading
Answer: Option D
4.) What is the purpose of the “super” keyword in Java?
A) To create a new instance of a class
B) To access static methods
C) To call the constructor of the superclass
D) To initialize instance variables
Answer: Option C
5.) Which OOP concept allows you to define a new class based on an existing class, inheriting its attributes and methods?
A) Abstraction
B) Polymorphism
C) Encapsulation
D) Inheritance
Answer: Option D
6.) What is encapsulation in Java?
A) Hiding the internal details of an object and providing a public interface
B) Defining multiple methods with the same name but different parameters
C) Creating a new class from an existing class
D) Storing data in a single variable
Answer: Option A
7.) Which access modifier allows a class’s members (fields and methods) to be accessible only within the same package?
A) private
B) protected
C) public
D) default (package-private)
Answer: Option D
8.) What is the relationship between a superclass and a subclass in Java?
A) Unrelated classes
B) Independent classes
C) Parent-child classes
D) Identical classes
Answer: Option C
9.) Which OOP concept allows a class to implement multiple interfaces?
A) Inheritance
B) Polymorphism
C) Encapsulation
D) Interface implementation
Answer: Option A
10.) What is the purpose of the “this” keyword in Java?
A) To create a new instance of a class
B) To refer to the current instance of the class
C) To access static members of the class
D) To define constructors
Answer: Option B