title: Why can outer Java classes access inner class private members?
body: <p>I observed that Outer classes can access inner classes private instance variables. How is this possible? Here is a sample code demonstrating the same:</p>
  
  <pre><code>class ABC{
      class XYZ{
          private int x=10;
      }
  
      public static void main(String... args){
          ABC.XYZ xx = new ABC().new XYZ();
          System.out.println("Hello :: "+xx.x); ///Why is this allowed??
      }
  }
  </code></pre>
  
  <p>Why is this behavior allowed?</p>