Collection allCollections = new ArrayList(); //集合里添加数据 allCollections.add("testName"); //判断即合理是否包含某特定的数据 if (allCollections.contains("testName")) { System.out.println("包含了testName"); }else{ System.out.println("没包含了testName"); }
标签:java,testName,Collection,System,println,allCollections,集合 From: https://www.cnblogs.com/yclh/p/17022701.html