This answer shows Java's visibility modifiers and their meaning:
Modifier | Class | Package | Subclass | World
————————————+———————+—————————+——————————+———————
public | y | y | y | y
————————————+———————+—————————+——————————+———————
protected | y | y | y | n
————————————+———————+—————————+——————————+———————
no modifier | y | y | n | n
————————————+———————+—————————+——————————+———————
private | y | n | n | n
My question is, why does allowing visibility to all subclasses imply that you must give visibility to all other classes in your package? In other words, why did the Java creators make it like this, as opposed to:
Modifier | Class | Subclass | Package | World
————————————+———————+—————————-+——————————+———————
public | y | y | y | y
————————————+———————+—————————+——————————+———————
no modifier | y | y | y | n
————————————+———————+—————————+——————————+———————
protected | y | y | n | n
————————————+———————+—————————+——————————+———————
private | y | n | n | n
A package is supposedly written and maintained by the same team; it's ok to have looser access control within a package, assuming the programmer have an intimate knowledge of all the code.
A subclass is often written by someone else; a stricter constraint on API is better.