/**
* @Title: ContainsTest.java
* @Package com.burns
* @Description: TODO(用一句话描述该文件做什么)
* @author 35725
* @date 2019年12月10日 上午11:52:35
* @version V1.0
*/
package com.burns;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName: ContainsTest
* @Description: TODO(这里用一句话描述这个类的作用)
* @author 35725
* @date 2019年12月10日
*
*/
public class ContainsTest {
public static void main(String[] args) {
List<List<String>> ll = new ArrayList<List<String>>();
List<String> l1 = new ArrayList<String>();
l1.add("1");
l1.add("2");
ll.add(l1);
List<String> l2 = new ArrayList<String>();
l2.add("1");
l2.add("2");
List<String> l3 = new ArrayList<String>();
l3.add("2");
l3.add("1");
System.out.println(ll.contains(l1));
System.out.println(ll.contains(l2));
System.out.println(ll.contains(l3));
System.out.println(l1.containsAll(l2));
System.out.println(l1.containsAll(l3));
System.out.println(l2.containsAll(l3));
}
}
输出
true
true
false
true
true
true