Organism - *I looked carefully at the specifications...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/**I looked carefully at the specifications produced by clicking the javadoc button and checked * that all the specifications of methods and the class specification were OK*/ public class Organism { private int level; //Position in foodchain (0 is lowest) private int mercury; //amount of methylmercury in this organism, in some predefined unit private boolean alive; //="this Organism is alive" (has not been eaten) private Organism eatenBy; //the name of the object of class Organism that (directly) ate /**this Organism, if this Organism is no longer alive - null if this Organism *is* alive.*/ private int numVictims; //number of Organisms this one has directly eaten. private String nickname; //optional name (String of length >=1) for this Organism - null if none. public Organism(int lev) { level= lev; mercury= mercury; alive= true; eatenBy= null; numVictims= 0; nickname= null; } public Organism(int lev, int m, String nn) { level= lev; mercury= m; alive= true; eatenBy= null; numVictims= 0;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2009 for the course CALS 2008 at Cornell.

Page1 / 2

Organism - *I looked carefully at the specifications...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online