一个朋友告诉我这是一个学习 Java 作用域的好例子,但我不明白。
是什么a
?我完全迷路了!
public class scopesexample {
public static a a = new a<a>(a(new a()));
public static class a<a> {
a a;
public a() {
this.a = a(a(null));
}
public a(a a) {
this.a = a;
}
public a a(a a) {
return a;
}
public String toString() {
return "a";
}
}
public static a a(a a) {
return new a<a>(a);
}
public static void main(String[] args) {
System.out.println( a );
System.out.println( a( a ) );
System.out.println( a.a );
a<a> a = new a<a>(a(new a()));
System.out.println(a.a( a ));
System.out.println( a );
System.out.println( a );
System.out.println(a.class);
System.out.println(a.getClass());
System.out.println(a.a);
System.out.println(a( a ));
System.out.println(a( a ).a);
}
}