Options

class inside static method

poguypoguy Member Posts: 91 ■■□□□□□□□□
public class Test {
public static void main(String args[]) {
class Foo {
public int i = 3;
}
Object o = (Object)new Foo();
Foo foo = (Foo)o;
System.out.println(“i = “ + foo.i);
}
}

So Foo is a static class, how come it can init an instance from static class?

thank you

Comments

Sign In or Register to comment.