According to the Java Language Specification, section 8.4.8.3, one cannot weaken the access privilege of a method when overriding, specifically:
The access modifier (§6.6) of an overriding or hiding method must
provide at least as much access as the overridden or hidden method, as
follows:
If the overridden or hidden method is public, then the overriding or
hiding method must be public; otherwise, a compile-time error occurs.
If the overridden or hidden method is protected, then the overriding
or hiding method must be protected or public; otherwise, a
compile-time error occurs.
If the overridden or hidden method has default (package) access, then
the overriding or hiding method must not be private; otherwise, a
compile-time error occurs.
This is done so if you have a superclass reference to the subclass object, then you can still call that method, no matter what class it is -- the superclass, or any subclass -- e.g.
Superclass obj = new Subclass();
obj.method();
It must still be public
.