This does not apply only to toString()
The Java Language Specification says
It is a compile-time error if a static method hides an instance method.
Since the instance method toString()
is implicitly inherited from Object
, declaring a method toString()
as static
in a sub type causes a compile-time error.
From an Object Oriented point of view, see the other answers to this question or related questions.