- package testFor;
- 可以呀,可以看看我的测试demo
- public class OutClass {
- String s11="s11";
- public String s22="s22";
- private String s33="s33";
- public static final String s44="s44";
- //定义不同访问权限的变量
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- InClass inClass=new OutClass().new InClass();
- //访问测试
- System.out.println(InClass.s4);
- System.out.println(inClass.s1);
- System.out.println(inClass.s2);
- System.out.println(inClass.s3);
- inClass.printOut();
- }
- public class InClass{
-
- String s1="s1";
- public String s2="s2";
- private String s3="s3";
- public static final String s4="s4";
- public static final String s5="";
- //定义不同访问权限的变量
- //访问测试
- void printOut(){
- System.out.println(s11);
- System.out.println(s22);
- System.out.println(s33);
- System.out.println(s44);
- }
- }
- }
复制代码 |