class TestInner {

    public static void main(String[] args) {

        Outer o1 = new Outer();
//      Inner i1 = o1.new Inner();      // compile error
//      Outer i1 = o1.new Inner();      // compile error

        Object obj1 = o1.new Inner();
        Object obj2 = new Outer().new Inner();  
        System.out.println("o1 class:   " + o1.getClass());          
        System.out.println("obj1 class: " + obj1.getClass());
        System.out.println("obj2 class: " + obj2.getClass());
        
        Outer.Inner i2 = o1.new Inner();
        Outer.Inner i3 = new Outer().new Inner();
    }
  
}

class Outer {

    static String test;
    String str = "Outer class field";

    Outer() {
        new Inner();
    }

    class Inner {           // class defined within the body of Outer
    
//      static String str;          // compile-error
//      static final String str;    // compile-error
        static final String str = "Constant is ok";
        
//      static {}           // static initializer not allowed
        
        
        Inner() {
            System.out.println(Outer.this.str);
            test = "Inherits static member";
            System.out.println(test);
        }
        
//      interface NeverInner();     // compile-error
    }      
                        
    public class PublicInner{}
    protected class ProtectedInner {}
    private class PrivateInner{}
    abstract class AbstractInner {}
    final class FinalInner {}
    static class StaticInner {}                        

}
