0
我不知道如何給每個方法運行命名對象逐步
public class Horse extends Animal{
int horsenum = 0;
}
public void reproduce(Horse h){
horsenum ++;
Horse newHorse = new Horse(); //Here is where I would like to name the new horse "newHorse1, newHorse2, etc."
使'horsenum'靜態,它應該工作.. – 2012-03-19 22:35:44
@MikeChristensen:你確定這將是穩定的?穩定! Geddit? – skaffman 2012-03-19 23:11:08
@skaffman - 除非馬匹在賽道上......那麼你可能會有比賽條件.. – 2012-03-19 23:43:50