📜  trier un tableau de string java 代码示例

📅  最后修改于: 2022-03-11 14:52:42.611000             🧑  作者: Mango

代码示例4
String[] names = {"John", "Steve", "Shane", "Adam", "Ben"};
System.out.println("String array before sorting : " + Arrays.toString(names));
Arrays.sort(names); 
System.out.println("String array after sorting in ascending order : " + Arrays.toString(names));