title: Java Multilevel Inheritance - Protected Instance Variable in Level 1 Class
body: <p>I have an question which comes under multilevel inheritance in Java. All Three Classes are in Same package</p>
  
  <p>I have class A  : </p>
  
  <pre><code>public class A {
     protected int x;
  }
  
  public class B extends A {
     public void doSomething {
        // x is visible.agreed, as it is a direct subclass of A
     }  
  }
  
  
  public class C extends B {
     public void doSomething {
        // x is still visible, how come? I mean it is at the 2nd level 
       //  I am confused why?
     }  
  }
  </code></pre>
  
  <p>does it like have any significance? or it is behavior which we have to take it by default?</p>