JAVA数组排序

import java.util.*;
class a{
 public static void main(String [] args){
  String name={"peten","Patricia","Hunter","Sarah","gabe"};
System.out.println("The Original order:");
for(int i=0;i<name.length;i++)
{
System.out.println(i+":"+name[i]);
}
Arrays.sort(name);
System.out.println("The new order:");
for(int i=0;i<name.length;i++)
{
System.out.println(i+":"+name[i]);
}
}
}

你可能感兴趣的:(java,职场,数组排序,休闲)