class TestStaticInnerClass {

    static String test = "Outer class static field";
    String instFld = "This is an instance field";

    public static void main(String[] args) {
        
        System.out.println(Inner.value);            
        new Inner();
    }

    static class Inner {
        
        static int value = 100;
        
        Inner() {
            System.out.println("New static inner class");   
            System.out.println(test); // access outer class field
//          System.out.println(instFld);  // not accessible directly

            // can create an instance of the outer class and then
            // access instance fields
            TestStaticInnerClass tsi = new TestStaticInnerClass();
            System.out.println(tsi.instFld);
            
        }
    }    
}

// compile the file and call from the command line using
// java Test
// code will compile clean and a new Inner object from
// TestStaticInnerClass will be created
class Test {
    public static void main( String[] args ) {
        new TestStaticInnerClass.Inner();
    }
}
