can't we select dynamically at what position we want to add the string like this
int r=k.nextInt();
Integer i6=new Integer(r);
System.out.println("Enter the address");
String p6=k.nextLine();
ar3.add(i6,p6);
its not excuting the after reading the integer