how to create an arraylist of a certain length java code example Example: java create arraylist with size ArrayList<Integer> arr=new ArrayList<Integer>(10);