title: Java Extending a class and setting values
body: <p><strong>Animal Base Class</strong>  </p>
  
  <pre><code>public class Animal
  {
  
  protected String pig;
  protected String dog;
  protected String cat;
  
  public void setPig(String pig_)
  {
    pig=pig_;
  }
  public void setCat(String cat_)
  {
    cat=cat_;
  }
  public void setDog(String dog_)
  {
    dog=dog_;
  }
  
  }
  </code></pre>
  
  <p><strong>AnimalAction Class</strong></p>
  
  <pre><code>public class AnimalAction extends Animal
  {
    public AnimalAction(String pig, String cat, String dog)
    {
         super.pig = pig;
         super.cat = cat;
         super.dog = dog;
    }
  
  }
  </code></pre>
  
  <p>Would this be the correct way to set protected variables? Is using protected variables the correct way to do this? Is there a more professional OO way to do?</p>