A class design requires that a particular member variable must be accessible by any subclasses of this class, but otherwise not by classes which are not members of the same package. What should be done to achieve this?Question 18 options:A) The variable should have no special access modifier.B) The variable should be marked protected.C) The variable should be marked private.D) The variable should be marked public.E) The variable should be marked private and an accessor method provided.

Respuesta :

To achieve, it is necessary to mark the variable as protected.

How does creating a protected class work?

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.

What procedures are in a class's subclass?

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

ACCESS MORE