In order to restrict a variable of a class from inherited to subclass how variable should be declared
Answers
Answered by
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
History,
6 months ago
English,
6 months ago
Math,
6 months ago
Social Sciences,
1 year ago
India Languages,
1 year ago
Social Sciences,
1 year ago