日期:2014-05-20 浏览次数:20705 次
class Test{ public static void main(String[] args){ First s = new Second(); System.out.println(s.var); System.out.println(s.var); } } class First { int var =1; int method(){ return var; } } class Second extends First { int var =2; int method(){ return var; } }