1 Star 0 Fork 3

notfand/LearnJava

forked from yswift/LearnJava 
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
ZooTest.java 490 Bytes
Copy Edit Raw Blame History
yswift authored 2020-04-27 15:33 +08:00 . add 泛型
package generic;
import java.util.Arrays;
import java.util.List;
public class ZooTest {
public static void main(String[] args) {
Zoo zoo = new Zoo();
System.out.println("before add animal, count = " + zoo.animalCount());
// 创建dog list 放入两只狗
List<Dog> dogs = Arrays.asList(new Dog(), new Dog());
// 加到动物园
zoo.addAnimals(dogs);
System.out.println("after add animal, count = " + zoo.animalCount());
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/notfand/LearnJava.git
git@gitee.com:notfand/LearnJava.git
notfand
LearnJava
LearnJava
master

Search