import java.util.Arrays;
import java.util.List;
import java.util.ListIterator;
public class MainClass {
public static void main(String args[]) {
String strings[] = { "J", "E", "L", "A", "P", "S", "G", "B", "K", "L" };
Arrays.sort(strings);
List list = Arrays.asList(strings);
displayList(list);
}
static void displayList(List list) {
System.out.println("The size of the list is: " + list.size());
ListIterator i = list.listIterator(0);
while (i.hasNext()) {
Object o = i.next();
if (o == null)
System.out.println("null");
else
System.out.println(o.toString());
}
}
}