1public class ArrayListExample
2{
3 public static void main(String[] args)
4 {
5 ArrayList<String> list = new ArrayList<>();
6
7 System.out.println(list.isEmpty()); //true
8
9 list.add("A");
10
11 System.out.println(list.isEmpty()); //false
12
13 list.clear();
14
15 System.out.println(list.isEmpty()); //true
16 }
17}
18