
class Outer {
	int x = 9;
	
	void test() {
		Inner inner = new Inner();
		inner.display();
	}
	
	class Inner {
		void display() {
			System.out.println("display from inner class, x = " + x);
		}
	}
	
	static class InnerStatic {
		void display() {
			Outer o = new Outer();
			System.out.println("display from static inner class, x = " + o.x);
		}
	}
}

public class NestedClassExample {

	public static void main(String[] args) {
	
		Outer out = new Outer();
		out.test();
		
		Outer.InnerStatic is = new Outer.InnerStatic();
		is.display();
	}

}
