public class Evolution {
public static void main(String[] args) {
Amoeba a1 = new Amoeba(5);
a1.setChromosomes(5);
a1.infoAmoeba(a1.num);
}
}
class Amoeba {
static int Amount;
static boolean established = false;
final public int num;
public Amoeba(int n) {
if (established) {
Amount += 1;
} else {
Amount = n;
}
established = true;
num = Amount;
}
private int Chromosomes;
public void setChromosomes(int x) {
Chromosomes = x;
}
public void infoAmoeba(int num) {
System.out.println("Amoeba №: " + num + ":");
if (Chromosomes == 0) {
System.out.println("Chromosomes: unknown " + "; " + "Amount: " + Amount + ";");
} else {
System.out.println("Chromosomes: " + Chromosomes + "; " + "Amount: " + Amount + ";");
}
}
}