java nested class private variable
类里面能使用内部内的私有变量,长见识了
package one; public class MyThread extends Thread { private int type; public MyThread(int type) { this.type = type; } @Override public void run() { System.out.println("MyThread run() type:" + type); int b = XX.a; // OK } private static class XX { private static int a = 3; } } class T { //int b = MyThread.XX.a; //error }

浙公网安备 33010602011771号