title: Protected variables can be accessed within Child Class or Child Object
body: <p>Is the <code>protected</code> variable of a <code>parentObject</code> be accessed from any child <code>Object</code>? or can be accessed only by only the particular <code>childObject</code>? I have a scenario which clearly expresses my doubt. </p>
  
  <p>I have two classes <code>ParentClass</code> and <code>ChildClass</code>. <code>ParentClass</code> is parent of <code>ChildClass</code>. I have a <code>protected</code> variable in <code>ParentClass</code> named <code>protVar</code>. It is of type <code>Object</code>. Then, I create two <code>Object</code>s like the following.</p>
  
  <pre><code>ParentClass p1 = new ParentClass();
  ChildClass c1 = new ChildClass();
  c1.callMethod(p1); // Here I want to access protected variable of p1 which is a separate object and Not initialized within c1 as super()
  </code></pre>
  
  <p>Now will I be able to access the <code>protVar</code> of <code>p1</code> from <code>c1</code>?</p>