//已有Dog对象
//第一种
Dog[] array1 = {
new Dog(),
new Dog(),
//...
};
//第二种
Dog[] array2 = new Dog[]{
new Dog(),
new Dog(),
//...
};
//第三种
Dog[] array3 = new Dog[SIZE];
//不建议使用(C++风格)
Dog array4[] = new Dog[SIZE];
网友评论