public class Paddock{
private ArrayList<Pig> pigs = new ArrayList<Pig>();
private boolean fertile;
private double area;
public Paddock() {
pigs = null;
area = 0.5;
fertile = false;
}
public boolean addPig(Pig a) {
boolean add = false;
pigs.add(a);
add = true;
return true;
}
这里,数组中为什么差不进去数 |