为什么是PrivateMatter类报错而不是Derived类不会通过编译呢?
class base{ public String className="Base"; } class Derived extends base{ private String className="Derived"; } public class privateMatter{ public static void main(String[] args){ System.out.println(new Derived().className); } }
|