title: Java grandchild object not allowed to call parent's or grandparent's methods
body: <p>I have have a class <code>A</code> in Java and <code>A</code> has some protected methods, I then have a class <code>B</code> which <code>extends</code> from <code>A</code> so that <code>B</code> can override those protected methods. I then want the ability to have a class <code>C</code> that <code>extends</code> from class <code>B</code> but class <code>C</code> should not be able to call <code>A</code>'s protected methods. Is there away to do that in Java? Do I just make the parent's class's method's overriden and have them final? i.g. </p>
  
  <pre><code>public class A()
  {
       protected void somemethod();
       protected int somevariable;
  }
  
  public class B() extends A
  {
      @Override
      final protected void somemethod();
          //How do I make some variable final or not accessible to my children?
      }
  
      public class C() extends B
      {
          //Now I cannot override somemethod! Is that right?
      }
  }
  </code></pre>