al.add("1 Romeo and Juliet");
al.add("2 Juliet");
al.add("3 Romeo");
al.add("4 Mercutio");
al.add("5 Tybalt");
al.add("6 Nurse");
al.add("7 Robert Smith");
al.add("8 The Cure");
al.add("9 Suede");
al.add("10 Neil Codling");
I want to add al.add("11 Brett Anderson") on that arraylist, but everytime I do that, the output is always like this:
1 Romeo and Juliet
10 Neil Codling
11 Brett Anderson
2 Juliet
3 Romeo
4 Mercutio
5 Tybalt")
6 Nurse
7 Robert Smith
8 The Cure
9 Suede
what I want to happen is the numbers are should be in order, from 1 - 11. what code should I put aside from Collections.sort(arrayname);?