长话短说,目标是在我需要构建构造函数的问题上挣扎。
我已经阅读了互联网上的例子,但仍然难以理解。
我拥有的是
public class Guppy
{
public static void main (String[] args)
{
int YOUNG_FISH = 10;
int MATURE_FISH = 30;
int MAXIMUM_AGE_IN_WEEKS = 50;
double MINIMUM_WATER_VOLUME_ML = 0.25;
String DEFAULT_GENUS = "Poecilia";
String DEFAULT_SPECIES = "reticulata";
double DEFAULT_HEALTH_COEFFICIENT = 0.5;
double MINIMUM_HEALTH_COEFFICIENT = 0.0;
double MAXIMUM_HEALTH_COEFFICIENT = 1.0;
}
// instance variables - replace the example below with your own
private String genus;
private String species;
private int ageInWeeks;
private boolean isFemale;
private int generationNumber;
private boolean isAlive;
private double healthCoefficient;
private int identificationNumber;
/**
* Constructor for objects of class Guppy
*/
public Guppy()
{
}