Java Classes and Objects

Last Updated :
Discuss
Comments

Question 1

Which of the following is NOT an OOP concept in Java?


  • Encapsulation

  • Inheritance

  • Polymorphism

  • Compilation

Question 2

What is an object in Java?

  • A class template

  • An instance of a class

  • A function

  • A primitive data type

Question 3

Which keyword is used to create an object in Java?

  • class

  • this

  • new

  • void

Question 4

What is a class in Java?

  • A data type

  • A blueprint for objects

  • A collection of methods

  • A single method

Question 5

What is the correct way to define a class in Java?


  • public Example {}

  • class Example {}

  • void Example {}

  • object Example {}

Question 6

What does this keyword refer to?

  • Current object

  • Parent class

  • Static method

  • Return type

Question 7

Which keyword refers to the immediate parent class object?


  • base

  • super

  • parent


  • this

There are 7 questions to complete.

Take a part in the ongoing discussion