1import java.util.ArrayList;
2public class ArrayListIsEmptyMethodExample
3{
4 public static void main(String[] args)
5 {
6 ArrayList<Integer> al = new ArrayList<Integer>();
7 // before checking ArrayList using isEmpty() method
8 System.out.println("Is ArrayList empty: " + al.isEmpty());
9 al.add(86);
10 al.add(25);
11 al.add(53);
12 al.add(85);
13 // after checking ArrayList using isEmpty() method
14 System.out.println("Is ArrayList empty: " + al.isEmpty());
15 for(Integer num : al)
16 {
17 System.out.println(num);
18 }
19 }
20}