i mean this line.
The index value must lie between 0 and list current size (Both inclusive) otherwise an Index just after the 13 for each paragraph.
The index always must be between 0 and list.size()-1 not only for get and remove methods but for all the methods which is a index is passed as parameters except the indexOf this is throwing exception as well you can see is a set method.
final List<String>myKidName = Arrays.asList("JOHN","STEPHEN","ORTIZ","RONDON");
System.out.println(myKidName.set(myKidName.size(),"LA ESTRELLA"));
But this is not throwing any.
Code: Select all
final List<String>myKidName = Arrays.asList("JOHN","STEPHEN","ORTIZ","RONDON");
System.out.println("myKidName = " + myKidName.indexOf(Integer.MAX_VALUE));