Trying to understand how to override methods/variables
<p>So I'm trying to understand overriding before I get to deep into my lesson. I watched TheNewBoston (bucky) explain overriding but I'm not sure if I'm doing it right. Would someone please spot check me and set me on the right path?</p>

<p>I don't remember bucky having to make any of his instance variables in his superclass protected. But when I was building my subclasses, eclipse made me convert my instance variables to protected.</p>

<p>Superclass Contacts:</p>

<pre><code>public class Contacts
{
    protected String fname;
    protected String lname;
    protected String email;
    protected String phone;

    public Contacts(String fname, String lname, String email, String phone)
    {
        this.fname=fname;
        this.lname=lname;
        this.email=email;
        this.phone=phone;

    }

    public String getfname()
    {
        return fname;
    }

    public void setfname(String first)
    {
        this.fname=first;       
    }

    public String getlname()
    {
        return lname;
    }

    public void setlname(String last)
    {
        this.lname=last;
    }

    public String getemail()
    {
        return email;
    }

    public void setemail(String e)
    {
        this.email=e;
    }

    public String getphone()
    {
        return phone;
    }

    public void setphone(String num)
    {
        this.phone=num;
    }

    public String getFullName()
    {
        String full=fname+" "+lname;
        return full;
    }
</code></pre>

<p>subclass Friend:</p>

<pre><code>public class Friend extends Contacts
{
    private String dob;


    public Friend(String fname, String lname, String email, String phone)
    {
        super(fname, lname, email, phone);
    }


    public String getDob()
    {
        return dob;
    }


    public void setDob(String dob)
    {
        this.dob = dob;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return fname+", "+lname+", "+email+", "+phone+", "+dob;
    }




}
</code></pre>

<p>subclass BusinessAssociate:</p>

<pre><code>public class BusinessAssociate extends Contacts
{
    private String title;
    private String position;
    private String company;
    private String full;

    public BusinessAssociate(String fname, String lname, String email,
            String phone)
    {
        super(fname, lname, email, phone);

    }

    public String getTitle()
    {
        return title;
    }

    public void setTitle(String title)
    {
        this.title=title;
    }

    public String getCompany()
    {
        return company;
    }

    public void setCompany(String company)
    {
        this.company=company;
    }

    public String getPosition()
    {
        return position;
    }

    public void setPosition(String position)
    {
        this.position=position;
    }

    /* (non-Javadoc)
     * @see Contacts#getFullName()
     */
    @Override
    public String getFullName()
    {
        full=title+" "+fname+" "+lname;
        return full;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return full+", "+email+", "+phone+", "+company+", "+position;
    }




}
</code></pre>
