class MyClassesDemo {
public static void main(String[] args) {
MyClass tlc = new MyClass();
MyClass.NestedMyClass ntlc;
ntlc = new MyClass.NestedMyClass();
}
}
class MyClass {
private int i;
private static String name = "MyClass";
{
System.out.println("Assigning 1 to i");
i = 1;
}
static class NestedMyClass {
int j;
{
System.out.println("Assigning 2 to j");
j = 2;
System.out.println(name);
}
}
}
|