public class MainClass { private int x = 0; public MainClass() { InnerOne inner = new InnerOne(); outerMethod(); } public static class InnerOne { private int x = 1; public void innerMethod() { System.out.println("enclosing x is " + x); } } public void outerMethod() { System.out.println("x is " + x); } public void makeInner() { InnerOne anInner = new InnerOne(); anInner.innerMethod(); } }