Need new access specifier

I think there must be another access specifier that is like protected but not friendly, I mean only the supclasses can access that, not the classes in that package.

Suppose a class that has private or friendly fields and I had to define another field of the same type for its subclass.

Or I have a class with a protected field that I know I will use it if I want to define a subclass of it. But I don't want to let the other classes in thatpackage modify this field unintentionally.

The problem is not only for fields. There are situations that I want to permit subclasses to call a method but I don't want other classes in the same package call it.

[677 byte] By [daniala] at [2007-10-2 7:06:06]
# 1
there isn't.perhaps you need to think more about which classes sit in which packages ?maybe a better package structure would give you this control.
David_Waddella at 2007-7-16 20:37:43 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
Maybe you should also consider subpackages. Protected will give access only to the classes in the packge and not to those in the subpackages.
beradriana at 2007-7-16 20:37:43 > top of Java-index,Other Topics,Patterns & OO Design...