title: Why can the private member of an nested class be accessed by the methods of the enclosing class?
body: <p>Could anyone tell me about the accessing level of private member? I have been confused with this piece code for quite a long time: why the private member, k of Line class, can be accessed in "print" method of outter class?</p>
  
  <pre><code>public class myClass {
      public static class Line{
          private double k;
          private double b;
          private boolean isVertical;
  
          public Line(double k, double b, boolean isVertical){
              this.k = k;
              this.b = b;
              this.isVertical = isVertical;
          }
  
      }
  
      public static boolean print(Line line){
          System.out.println(line.k);
      }
  }
  </code></pre>