Java Quiz Day 15

Last Updated :
Discuss
Comments

Question 1

Which of the following is not an OOPs concept?

  • Encapsulation


  • Inheritance

  • Compilation

  • Polymorphism


Question 2

What is a class in Java?

  • A data type

  • A blueprint for objects

  • A collection of methods

  • A single method

Question 3

Which keyword is used to create an object in Java?

  • class

  • define


  • new

  • create

Question 4

What is the purpose of a constructor?


  • Destroy objects

  • Allocate memory

  • Initialize objects

  • Call main() method

Question 5

Which of the following statements about constructors is true?


  • Constructor has a return type

  • Constructors can be static

  • Constructor name must match class name

  • Constructor can be abstract


Question 6

What does this keyword refer to?

  • Current object

  • Parent class

  • Static method

  • Return type

Question 7

Which keyword is used for inheritance in Java?


  • inherit

  • implements

  • super

  • extends

Question 8

Which keyword refers to the immediate parent class object?


  • base

  • super

  • parent


  • this

There are 8 questions to complete.

Take a part in the ongoing discussion