Tag: access-modifiers

57 votes
29 answers
2K views
What is the difference between public, protected, package-private and private in Java?

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private),

avatar
Lynette
0 1 0 9
asked 07 September, 2021