/** EcoSystem will model the interactions between species in
 *  an ecosystem.
 */
import java.io.*;
public class EcoSystem{
  // this BufferedReader is static so there is a single copy for
  // the entire EcoSystem class, not one per instance.
  private static BufferedReader br;

  // main method is what Java "runs"
  // it needs a 'throws IOException' clause because it uses
  // a BufferedReader
  public static void main(String[] args) throws IOException {
    br= new BufferedReader(new InputStreamReader(System.in));
    String inputString;
    int inputInt;

    // create a Species
    Species gnu= new Species(7,"gnu gnusance");

    // print it:
    System.out.println("New species: "+gnu);

    // print its population
    System.out.println("population: "+ gnu.getPopulation());

    // prompt for another species from the keyboard
    System.out.println("New species name: ");
    inputString= br.readLine();
    System.out.println("New species population: ");
    inputInt= Integer.parseInt(br.readLine());
    Species gnome= new Species(inputInt, inputString);

    //add another species, plus species names
    Species gnat;
    gnat= new Species(1000,"gnat gnattus");

    // try some String functions out
    String s= gnu.getName();
    s= s.concat(s);
    System.out.println(s);
    System.out.println("The length of s is: "+s.length());
  }
}

