+ 4
What does it mean when you declare a variable like int as"protected"?
does it mean the same as private...
5 Answers
+ 2
thanks!
+ 1
protected means only inheritance class of mother class and mother class itself can access and modified it.
+ 1
Variables, methods, and constructors, which are declared protected can be accessed only by the subclasses in other package or any class within the package of the protected members' class.
0
Protected means visible from subclasses and from classes of the same package.
0
Absolutelly not. Private means visible only from the class itself, not from subclasses or package classes.