ArrayList < ArrayList > arr = new ArrayList(); for(int i = 0; i < no; i++) arr.add(new ArrayList ());