1ArrayList<String> listOfBanks = new ArrayList<>();
2int size = listOfBanks.size();
3System.out.println("size of array list after creating: " + size);
1import java.util.ArrayList;
2import java.util.List;
3public class Demo {
4 public static void main(String[] args) {
5 List aList = new ArrayList();
6 aList.add("Apple");
7 aList.add("Mango");
8 aList.add("Guava");
9 aList.add("Orange");
10 aList.add("Peach");
11 System.out.println("The size of the ArrayList is: " + aList.size());
12 }
13}