Women in Technology

Hear us Roar

  Readable Java 1.5
Subject:   Cholesterol - WTF?
Date:   2003-09-26 11:03:07
From:   anonymous2
Response to: Cholesterol - WTF?

I think he may have been referring to the fact that static methods are not class methods at all, you cannot override them in subclasses.

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Cholesterol - WTF?
    2003-09-26 12:33:01  anonymous2 [View]

    Static methods are not called polymorphically. They are called by the name of the class they belong to, and not by using an object that's an instance of the class they belong to. So of course they can't be overridden in subclasses. If you want a method that's overridable, simply don't make it static.