1 Collection<Object> list = new ArrayList<>();
2 list.size();
3
4 // All collections use size()
5 // array use array. length
6
1ArrayList<String> listOfBanks = new ArrayList<>();
2int size = listOfBanks.size();
3System.out.println("size of array list after creating: " + size);