title: Is there a constructor associated with nested classes
body: <p>I want to know if there are any constructors involved with inner classes. for example consider the code snippet given below</p>
  
  <pre><code>class MyOuter
  {
     private int x= 10;
  
     class MyInner
     {
        void dostuff(){
           System.out.println("The value of x is "+x);
        }
     }
  }
  </code></pre>
  
  <p>In another java file i create instances for both MyOuter and MyInner classes as shown below</p>
  
  <pre><code>Class Program
  {
     public static void main(String [] args)
     {
        MyOuter mo = new MyOuter();
        MyOuter.MyInner mi = mo.new MyInner();
        mi.dostuff();
     }
  }
  </code></pre>
  
  <p>The above code snippet compiles fine and gives output of "The value of x is 10".</p>
  
  <p>What i want to know here is whether a constructor is invoked when new() is used with MyInner class and MyOuter class. If yes, then is there any constructor chaining from inner class to outer class (like subclass calls constructor of super class and so on).</p>