Archive
Java에서 static method가 오버라이드 될 수 없는 이유
epicdev
2011. 11. 14. 14:43
출처: http://stackoverflow.com/questions/2223386/why-doesnt-java-allow-overriding-of-static-methods
Overriding depends on having an instance of a class. The point of polymorphism is that you can subclass a class and the objects implementing those subclasses will have different behaviors for the same methods defined in the superclass (and overridden in the subclasses). A static method is not associated with any instance of a class so the concept is not applicable.
Overriding depends on having an instance of a class. The point of polymorphism is that you can subclass a class and the objects implementing those subclasses will have different behaviors for the same methods defined in the superclass (and overridden in the subclasses). A static method is not associated with any instance of a class so the concept is not applicable.