首页 > 代码库 > Java 面试题收集

Java 面试题收集

/** * Created by qhong on 2017/2/5. */public class Base{    private String baseName = "base";    public Base()    {        callName();    }    public void callName()    {        System. out. println(baseName);    }    static class Sub extends Base    {        private String baseName = "sub";        public void callName()        {            System. out. println (baseName) ;        }    }    public static void main(String[] args)    {        Base b = new Sub();    }}
技术分享
null
View Code

 

 

 

 

http://blog.csdn.net/Two_Water/article/details/53891952

Java 面试题收集