Math, asked by iamlall9353, 1 year ago

In order to restrict a variable of a class from inherited to subclass how variable should be declared

Answers

Answered by ankurbadani84
2

Answer:

b) Private

Step-by-step explanation:

Missing options in the answer :-

a) Protected

b) Private

c) Public

d) Static

In Java we can define following types of variables - Protected , Private, Public and static . Private variables are not accessible in the inherited subclass. In fact, private variables are visible on the class where it is defined.

Similar questions