Home » JAVA Programming » Inheritance » Question
  1. In order to restrict a variable of a class from inheriting to subclass, how variable should be declared?
    1. Protected
    2. Public
    3. Static
    4. Private
    5. None of these
Correct Option: D

By declaring variable private, the variable will not be available in inherited to subclass.



Your comments will be displayed only after manual approval.