标签:
public class Fu { String num = "fu"; static String age ="fu static"; void show() { System.out.println("fu show "); } static void method() { System.out.println("fu static method "); } } public class Zi extends Fu { String num = "zi"; static String age ="zi static"; void show() { System.out.println("zi show "); } static void method() { System.out.println("zi static method "); } public static void main(String[] args) { Fu f =new Zi(); System.out.println(f.num); System.out.println(f.age); f.show(); f.method(); } }
-----------------------------------------------------------------------------------------------------------------
运行结果
fu
fu static
zi show
fu static method
标签:
原文地址:http://www.cnblogs.com/52hadoop/p/4708802.html