I have a program which has the user inputs a list of names. I have a switch case going to a function which I would like to have the names print off in alphabetical order.
public static void orderedGuests(String[] hotel)
{
//??
}
I have tried both
Arrays.sort(hotel);
System.out.println(Arrays.toString(hotel));
and
java.util.Collections.sort(hotel);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…