KnowledgeBoat Logo
|

Computer Applications

Read the following text and choose the correct answer:

Public access specifier allows a class to expose its member variables and member functions to other functions and objects. Any public member can be accessed from outside the class.

Which of these access specifier must be used for class so that it can be inherited by another subclass?

  1. public
  2. private
  3. protected
  4. none of the mentioned

Encapsulation & Inheritance in Java

1 Like

Answer

public

Reason — According to the given context, public access specifier can be used for class so that it can be inherited by another subclass.

Answered By

3 Likes


Related Questions