首页 > 编程语言 >java集合Collection操作

java集合Collection操作

时间:2023-01-03 16:57:57浏览次数:33  
标签:java testName Collection System println allCollections 集合

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

相关文章