0
What are the differences between public, private, and protected?
I am in my java class and my teacher doesn't really like to use the protected method I was wondering if is really not that useful.
1 Respuesta
0
protected gives access to the methods and variables of a class inside the same package and to the class's derived classes.
public gives access from everywhere and private only allows access from inside the class.