/** Species models a biological species, keeping track of the number
 *  of individuals.
 */
public class Species{
  // how many are there?  What's this species called?
  private int population;
  private String name;

  // How many Species are there?  This information is static:
  // there is one copy for the entire Species class.  Although
  // the default value of a static variable is 0, we can
  // explicitly initialize it to 0.
  private static int count= 0;

  // getCount: return the number of species there are
  public static int getCount() {
    return count;
  }

  /** construct a species with name n and population num.
   *  This sort of makes setPopulation() and setName()
   *  redundant.  Also, increment the number of Species by
   *  one.
   */
  public Species(int num, String n) {
    population= num;
    name= n;
    count= count + 1;
  }

  /** getPopulation returns the number of individuals current
   *  in this Species.
   */
  public int getPopulation(){
    return population;
  }

  /** setPopulation makes this Species have population num.
   */
  public void setPopulation(int num){
    population = num;
  }

  /** setName: call this species n
   */ 
  public void setName(String n) {
    name = n;
  }

  /** getName: return this species' name
   */
  public String getName() {
    return name;
  }

  /** breed: increase this species' population by 1
   */
  public void breed() {
    population = population + 1;
  }

  /** dieOff: decrease this species' population by 1
   */
  public void dieOff() {
    population = population - 1;
  }
}


  

