java 静态方法能否被覆盖?????
如题:(core java)java静态方法能否被覆盖?????
class Super{ static String greeting(){ return "Good night"; } String name(){ return "Richard"; } } class Sub extends Super{ static String greeting(){ return "Hello"; } String name(){ return "Dick"; } } class Test{ public static void main(String[] args){ Super s = new Sub(); System.out.println(s.greeting()+","+s.name()); } }运行结果://~~Good night,Dick