title: How do I access subclass attributes passed down from superclass?
body: <p>I have a subclass that extends from it's parent class and I'm having trouble understanding how I would access object attributes from the subclass that were inherited from the parent class.</p>
  
  <p>In my example, I'll call the class <code>Friend</code> which inherits <code>name</code> and <code>phone</code> from <code>Acquaintance</code> but has it's own variables <code>birthdate</code> and <code>address</code>. Once that's created, I want to print the content of a <code>Friend</code> object which includes <code>name</code>, <code>phone</code>, <code>birthdate</code>, <code>address</code>.</p>
  
  <p>Because I want my variables to all be private, I figured I would use getters, but I'm not sure how I would call the parent class in this case.</p>
  
  <pre><code>public class Acquaintance {
  
      private String name;
      private String phone;
  
      public Acquaintance(String name, String phone) {
  
          this.name = name;
          this.phone = phone;
      }
  
      public static String getName() {
          return this.name;
      }
  
      public String getPhone() {
          return this.phone;
      }
  
      public void printContact() {
          System.out.println("Name: " + this.name + ", Phone: " + this.phone);
  
      }
  
  }
  </code></pre>
  
  <p>Subclass:</p>
  
  <pre><code>public class Friend extends Acquaintance {
  
      private String address;
      private String birthdate;
  
      public Friend(String name, String phone, String birthdate, String address) {
          super(name, phone);
          this.address = address;
          this.birthdate = birthdate;
      }
  
      public void printContact() {
          /* This is where I'm having trouble. 
          I don't know how to access the name, 
          and phone which are contained in the superclass.
          */
  
  
          System.out.println("Name: " + "Phone: " + "Birthdate: " + this.birthdate + "Address: " + this.address);
      }
  
  }
  </code></pre>