I understand that the rule of thumb in OOD minimizes access to all members of a given object as much as possible.
C # and Java seem to implement the same set of access modifiers; however, something that puzzled me for some time is why Java classes seem to be mostly declared publicly available, and C # classes are generally considered the default. Is there any subtlety for these languages that imposes these differences, or is it just a matter of agreement or what?
I often review my C # code (I usually make most classes publicly available, with the exception of inner classes, anonymous classes, and other classes with a narrow scope and utility) in an attempt to please the compiler, however, I wonder if I can do something important.
source
share