title: How do I access the super-super class, in Java? [Mini-example inside]
body: <p>In the example below, how can I access, from <code>C</code>, the method <code>method()</code> of the class <code>A</code>?</p>
  
  <pre><code>class A {
      public void method() { }
  }
  
  class B extends A{
      public void method() { }
  }
  
  class C extends B{
      public void method() { }
  
      void test() {
          method();          // C.method()
          super.method();    // B.method()
          C.super.method();  // B.method()
          B.super.method();  // ERROR &lt;- What I want to know
      }
  }
  </code></pre>
  
  <p>The error I am getting is </p>
  
  <blockquote>
    <p>No enclosing instance of the type B is
    accessible in scope</p>
  </blockquote>
  
  <p><strong>Answer: No, this is not possible. Java doesn't allow it. <a href="https://stackoverflow.com/questions/586363/why-is-super-super-method-not-allowed-in-java">Similar question</a>.</strong></p>