public class MyClass {

   public static void main(String[] args)  {

      MyClass myC = new MyClass();

      innerClass inC = myC.new innerClass("inner");
      // innerClass inC2 = new innerClass("in"); = ERROR
      // innerClass inC3 = MyClass.new innerClass("inner"); = ERROR


      // I wonder why the following command in line 15 works flawlessly:
      // now we can easily access the inC object and its variable directly. But why?
      // When we created it before, we could only do this through the myC object!
      System.out.println(inC.name);
      // System.out.println(myC.inC.name); = ERROR = so inC is not an instance-variable of myC object
      // System.out.println(MyClass.inC.name); = ERROR, "static context..."
   }

   public class innerClass { // not static! Intentionally.

      public String name;

      public innerClass(String name) {
          this.name = name;
      }
   }
}