title: Best practice to access private parent attributes?
body: <p>Imagine you have two classes, the <code>Parent</code> class and the <code>Child</code> class which inherit from <code>Parent</code>. <code>Parent</code> has an Attribute <code>a</code> which is set at private, and the child class has a <code>doSomething()</code> method which need to access to <code>a</code> like :</p>
  
  <pre><code>public class Parent {
    private Attriute a;
    public Parent(Attribute a) {
      this.a = a;
    }
  }
  
  public class Child extends Parent {
    public Child(Attribute a) {
      super(a);
    }
    public void doSomething() {
      // Need to access to a here
    }
  }
  </code></pre>
  
  <p><strong>My question is</strong> : is there a best way to access to <code>a</code> from <code>Child</code> ? I have few ideas of how to proceed :</p>
  
  <ul>
  <li>Set visibility of <code>a</code> at <code>protected</code> in <code>Parent</code> but then <code>a</code> would be accessible and modifiable evrywhere in the package.</li>
  <li>Create a protected getter in <code>Parent</code> of <code>a</code> but it would also be accessible evrywhere in the package.</li>
  <li>Create a new private <code>Attribute</code> field in the <code>Child</code> class and save <code>a</code> into it in the constructor. Like this the 'new a' attribute would be only accessible from <code>Child</code> and it would be the same object than the <code>Parent</code> one but it would also 'duplicated' <code>a</code> in both classes.</li>
  </ul>
  
  <p>But I don't know which one is the best one, maybe none of these is, so HELP !!</p>