NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
a private class? maybe for inner classes, but I definitely wouldn't recommend it otherwise :)
I think you ment the access modifiers public-protected-private(-package) for the variables?
stultuske
Industrious Poster
4,489 posts since Jan 2007
Reputation Points: 1,377
Solved Threads: 628
Skill Endorsements: 25
a private class? maybe for inner classes, but I definitely wouldn't recommend it otherwise :)
The all-important JLS section 8.1.1 says
The access modifiers protected and private (§6.6) pertain only to member classes within a directly enclosing class or enum declaration (§8.5).
For example you may have a class that represents a collection of Things that you will want to sort in various different orders. You create private member classes for the different Comparators that you use in your sorting.
JamesCherrill
... trying to help
8,668 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,477
Skill Endorsements: 33