ArrayList in Q:java can be sorted with a~z alphabetical output.
A:collections.sort (list); This is sorted by nature and is sorted alphabetically
A:import java.util.ArrayList;
Import java.util.Collections;
public class app{
public static void Main (String args[]) {
Arraylist<character> al=new arraylist<character> ();
for (int i=0;i<20;i++) {
Al.add ((char) (' a ' + (int) (Math.random () *26));
}
System.out.println (AL);
Collections.sort (AL);
System.out.println (AL);
}
}
A:list are unordered, repeatable collections, and naturally there are no sorting methods.
A:list does not have its own sorting method, only set has its own sorting method, but it can be sorted by collections in the sort method of a set.
A:list sorting method without self-band
But you can sort by arrays.sort () first.
And then build the list.
List minn= arrays.aslist (score);