Java OOPs Concept Quiz 3
Time left: 10:00

1. 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

2. 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

3. What is an abstract method in Java?

  • A method that has no body
  • A method that has a body
  • A method that can be called statically
  • A method that has no parameters

4. Can a class be both abstract and final in Java?

  • Yes
  • No
  • Only if it has no methods
  • Only if it is a static class

5. What is the purpose of method overriding in Java?

  • To provide a specific implementation of a method in a subclass
  • To create multiple methods with the same name but different parameters
  • To define the behavior of objects
  • To define classes

6. Can an abstract class have a constructor in Java?

  • Yes
  • No
  • Only if it is a static constructor
  • Only if it has no methods

7. What is the purpose of method overloading in Java?

  • To create multiple methods with the same name but different parameters
  • To create a method with the same name in a subclass
  • To create a method with the same name in the same class
  • None of the above

8. What is the main difference between an interface and an abstract class in Java?

  • An interface can have only abstract methods, while an abstract class can have both abstract and concrete methods
  • An abstract class can have only abstract methods, while an interface can have both abstract and concrete methods
  • An interface can be instantiated, while an abstract class cannot
  • An abstract class can be instantiated, while an interface cannot

9. 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

10. 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