출처: 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.
'Archive' 카테고리의 다른 글
Agile 원칙 12가지 (0) | 2011.11.14 |
---|---|
다섯가지의 소프트웨어 테스트 (0) | 2011.11.14 |
Unit test와 functional test의 차이점 (0) | 2011.11.14 |
왜 inner class는 final local variable만 액세스 가능한가 (0) | 2011.11.14 |
두가지 대표적인 프로그래밍 스타일 (0) | 2011.11.10 |