Java OOPs Concept Quiz 1
Time left: 10:00

1. What is encapsulation in Java?

  • The process of defining a class
  • The process of wrapping data and code together
  • The process of creating objects
  • The process of defining methods

2. What is polymorphism in Java?

  • The ability of a variable, function, or object to take on multiple forms
  • The process of wrapping data and code together
  • The process of defining methods
  • The process of creating objects

3. What is inheritance in Java?

  • The process by which one class acquires the properties of another class
  • The process of defining methods
  • The process of creating objects
  • The process of wrapping data and code together

4. Which of the following is an example of method overloading?

  • Creating multiple methods with the same name but different parameters
  • Creating a method with the same name in the subclass
  • Creating multiple methods with different names
  • None of the above

5. What is method overriding in Java?

  • A subclass provides a specific implementation of a method already defined in its superclass
  • Creating multiple methods with the same name but different parameters
  • Creating a method with the same name in the same class
  • None of the above

6. What is an abstract class in Java?

  • A class that cannot be instantiated
  • A class that can be instantiated
  • A class that cannot have methods
  • A class that can only have static methods

7. What is an interface in Java?

  • A class that can implement multiple interfaces
  • A reference type in Java that is similar to a class
  • A class that can only have abstract methods
  • None of the above

8. What is the purpose of the "super" keyword in Java?

  • To refer to the immediate superclass object
  • To create a new object
  • To refer to the current class object
  • To refer to a static method

9. Can a class implement multiple interfaces in Java?

  • Yes
  • No
  • Only if the interfaces have different methods
  • Only if the class is abstract

10. What is the purpose of the "this" keyword in Java?

  • To refer to the current class object
  • To create a new object
  • To refer to the immediate superclass object
  • To refer to a static method