Usage of default access modifier

Some programmers don't use the default access modifier (package level). Is there a specific reason? If so, what is it? Or is it a good to use default access modifier?Thank you,Srikanth
[206 byte] By [sri1025a] at [2007-10-3 2:55:27]
# 1

> Is there a specific reason?

You'd probably get the best answer by finding a programmer that fits such a description and asking them.

> If so, what is it?

I can't think of a reason to categorically avoid using the default access modifier.

> Or is it a good to use default access modifier?

It's a good idea to use it when the situation calls for it; i.e., the design requires package visibility of a member, but no more.

~

yawmarka at 2007-7-14 20:44:33 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
I have a situation where default access modifier is the perfect one to use, but just wanted to confirm whether it's a discouraged modifier or not. Seems like it's not.Thank you,Srikanth
sri1025a at 2007-7-14 20:44:33 > top of Java-index,Other Topics,Patterns & OO Design...
# 3

Some prefer to grant or limit access to an object by the interface they expose. In this case all methods are either public or private. Access is restricted based on the fact that only the appropriate code is given references of certain interface types and if code does not have the right interface, they can not access the method.

Its a different style, but I use it myself quite a bit. This way I never am concerned over if it should be public,private, protected or default. The choice is simpler. But sometimes it can make you create interfaces for really simple things which I am not uptight enough to do...

_dnoyeBa at 2007-7-14 20:44:33 > top of Java-index,Other Topics,Patterns & OO Design...