package listtest;

import java.util.ArrayList;
import java.util.List;

public class ListTest {
    public static void main(String[] args) {
        List list = new ArrayList();
        list.add("张三");
        list.add(90);
        list.add(true);
        System.out.println(list);//[张三, 90, true]

        list.remove("张三");
        list.remove(1);
        System.out.println(list);//[90]

        System.out.println(list.contains(90));//true
        System.out.println(list.size());//1
        System.out.println(list.isEmpty());//false

        List list1 = new ArrayList();
        list1.add("李四");
        list1.add("去超市");
        list.addAll(list1);
        System.out.println(list);//[90, 李四, 去超市]
        list.removeAll(list1);
        System.out.println(list);//[90]
        //清空list
        list.clear();
        System.out.println(list);//[]

    }
}