To achieve, it is necessary to mark the variable as protected.
protected According to a class design, a certain member variable must be accessible by all subclasses of this class but not by classes that are not part of the same package.
With one exception—parent class members are not available from within the methods of a child class—a subclass's methods can Every object is an instance of the Object class. use all of the data fields and parent class's methods. An instance of the Object class exists in every object.
To know more about variable visit :-
https://brainly.com/question/17344045
#SPJ4