Java Classes and Objects

Last Updated :
Discuss
Comments

Question 1

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


  • A

    Encapsulation

  • B

    Inheritance

  • C

    Polymorphism

  • D

    Compilation

Question 2

What is an object in Java?

  • A

    A class template

  • B

    An instance of a class

  • C

    A function

  • D

    A primitive data type

Question 3

Which keyword is used to create an object in Java?

  • A

    class

  • B

    this

  • C

    new

  • D

    void

Question 4

What is a class in Java?

  • A

    A data type

  • B

    A blueprint for objects

  • C

    A collection of methods

  • D

    A single method

Question 5

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


  • A

    public Example {}

  • B

    class Example {}

  • C

    void Example {}

  • D

    object Example {}

Question 6

What does this keyword refer to?

  • A

    Current object

  • B

    Parent class

  • C

    Static method

  • D

    Return type

Question 7

Which keyword refers to the immediate parent class object?


  • A

    base

  • B

    super

  • C

    parent


  • D

    this

There are 7 questions to complete.

Take a part in the ongoing discussion