title: Java: Inner class inside an inner class
body: <p>Please excuse me if this question has been asked before.
  I have searched around the web and here at stack <strong>overflow</strong>.</p>
  
  <p><strong>Case:</strong></p>
  
  <p>I am stuck at my java project and the compiler won't compile my project when I try to use
  an inner class inside another.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>public class outer  {
      public class middle {
          public class inner  {
              public int variable = "8";
          }
      }
  }
  </code></pre>
  
  <p><strong>Declaration:</strong></p>
  
  <p>I am trying to declare the classes like this:</p>
  
  <pre><code>outer outerObject = new outer();
  outerObject.middle middleObject = outerObject.new middle();
  outerObject.middleObject.inner innerObject = outerObject.middleObject.new inner();
  </code></pre>
  
  <p><strong>Compilation results:</strong></p>
  
  <pre><code>source\start.java:8: error: cannot find symbol
                        outerObject.middleObject.inner innerObject = outerObject
  .middleObject.new inner();
  ^
  </code></pre>
  
  <p>Any reply would be much appreciated! Wether my intentions are impossible or if I am simply doing something wrong.</p>
  
  <p><strong>Have a nice day!</strong></p>