title: Acessing grandparent's method in java
body: <p>i am working on practice problems  simple OOP concepts using java
  the question gives a uml diagram and asks to implement .
  i went through a problem it asks me to access a method in the grandparent class from the child class.</p>
  <p>see illustration :</p>
  <pre><code>    
  class Grandparent { 
      public void Print() { 
          System.out.println(&quot;Grandparent's Print()&quot;); 
      } 
  } 
  
  class Parent extends Grandparent { 
      public void Print() {    
          System.out.println(&quot;Parent's Print()&quot;); 
      } 
  } 
  
  class Child extends Parent { 
      public void Print() { 
          super.super.Print(); // Trying to access Grandparent's Print() 
          System.out.println(&quot;Child's Print()&quot;); 
      } 
  } 
  
  public class Main { 
      public static void main(String[] args) { 
          Child c = new Child(); 
          c.Print(); 
      } 
  } 
   
  </code></pre>
  <p>i have done my reasearch everywhere i found that java doesn't allow that due to apllying Encpculation however it is allowed in C++ , my question is can i  do something to get that method from grandparent class beside the not allowed ( super.super.method() ) statement in java .</p>
  <p>i mean can i change the structure in such a way i kep the inhertiance as it is and can access that method with missing the UML .</p>