📜  Java 代码示例的快速查找

📅  最后修改于: 2022-03-11 14:52:14.738000             🧑  作者: Mango

代码示例1
Set animals = new HashSet(
                          Arrays.asList("cat", "dog", "squirrel", "raccoon"));
if (animals.contains("dog")) {
    System.out.println("Yep, dog's here!"); // prints
}
if (!animals.contains("aardvark")) {
    System.out.println("Ah, aardvark's missing!"); // prints
}