packagecom.Class.Demo02;//外部类publicclassOuter{//外部类属性privateString name ="特朗普";privateint age =18;//静态内部类,等级与外部类相同staticpublicclassInner{//静态内部类属性privateString city ="上海";privateString phone ="111";//静态内部类静态属性privatestaticString nickname ="懂王";//方法publicvoidshow(){//怎么访问外部类属性? new一个对象来访问Outer outer =newOuter();System.out.println(outer.name);System.out.println(outer.age);//静态内部类属性直接访问System.out.println(city);System.out.println(phone);//访问静态属性System.out.println(Inner.nickname);}}}