packagebeginnersbook.com;importjava.util.ArrayList;publicclassIsEmptyExample{publicstaticvoidmain(String args[]){//ArrayList of Integer TypeArrayList<Integer> al =newArrayList<Integer>();//Checking whether the list is emptySystem.out.println("Is ArrayList Empty: "+al.isEmpty());//Adding Integer elements
al.add(1);
al.add(88);
al.add(9);
al.add(17);//Again checking for isEmptySystem.out.println("Is ArrayList Empty: "+al.isEmpty());//Displaying elements of the listfor(Integer num: al){System.out.println(num);}}}