KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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.
Tags (comma-separated)
Save Edits
Cancel