标签:list() class out system lse nbsp array print contains
判断List是否包含元素
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
标签:list() class out system lse nbsp array print contains
原文地址:https://www.cnblogs.com/StefanieYang/p/12850871.html