Java-List元素判断
2021-01-26 19:14
阅读:477
标签:list() class out system lse nbsp array print contains 判断List是否包含元素 Java-List元素判断 标签:list() class out system lse nbsp array print contains 原文地址:https://www.cnblogs.com/StefanieYang/p/12850871.html
List list = new ArrayList();
list.add("aa");
list.add("bb");
list.add("cc");
System.out.print(list.contains("cc"));
//输出结果--true
System.out.print(list.contains("dd"));
//输出结果--false
评论
亲,登录后才可以留言!