Hi All,
I understand that the rule of thumb in OOD is to minimize access to all members of a given object as best as can be reasonably accomplished.
C# and Java both seem to implement the same set of access modifiers; however, something which has bewildered me for some time now is why Java classes seem to be mostly declared as public while C# classes seem mostly to be declared as default. Is there some subtlety to these languages which imposes these differences, or is it simply a matter of convention or what?
I find myself frequently going through my C# code (I habitually make most classes public, excepting inner classes, anonymous classes, and other classes of narrow scope and usefulness) in an attempt to please the compiler, however I wonder if I may be missing something important.
Thanks, Brian
PS - Not sure how subjective this may be; would this make a better wiki question? PPS - I've already read Effective Java by Josh Bloch and understand that you should limit access to things as much as possible. That is not my question.