title: Why can’t this static inner class call a non-static method on its outer class?
body: <p>I'm currently reading <em>Effective Java</em> by Joshua Bloch and I love it! But on page 112 (Item 24) Bloch writes:</p>
  
  <blockquote>
    <p>A static member class is the simplest kind of nested class. It is best
    thought of as an ordinary class that happens to be declared inside
    another class and has access to all of the enclosing class’s members,
    even those declared private.</p>
  </blockquote>
  
  <p>And that really confuses me. I would rather say:</p>
  
  <blockquote>
    <p>A static member class is the simplest kind of nested class. It is best
    thought of as an ordinary class that happens to be declared inside
    another class and has access to all of the enclosing class’s <strong>static</strong> members,
    even those declared private.</p>
  </blockquote>
  
  <p>Here is a snippet that illustrates my understanding of the quote:</p>
  
  <pre><code>public class OuterClass {
  
      public void printMessage(String message) {
          System.out.println(message);
      }
  
      private static class InnerClass {
  
          public void sayHello() {
              printMessage("Hello world!"); //error: Cannot make a static reference to the non-static method printMessage(String)
          }
  
      }
  }
  </code></pre>
  
  <p>You can see that InnerClass's sayHello method does not have access to OuterClass's printMessage method as it is declared in a static inner class while the printMessage method is an instance method. It looks like the author suggests that a static member class can access nonstatic fields of the enclosing class. I am convinced that I have misunderstood something in his last sentence but I cannot figure out what. Any help will be appreciated!</p>
  
  <p>edit: I changed the visibility of the two methods because it is irrelevant to my question. I'm interested in static members, not private members.</p>