- import java.util.Arrays;
- public class Ch39
- {
- public static void main(String args[])
- {
- int n[]={34,65,7,-3,6546,-564,0,-11,90,123};
- System.out.print("排序前:");
- for(int x=0;x<n.length;x++)
- System.out.print(n[x]+" ");
- System.out.println();
- Arrays.sort(n);
- System.out.print("排序後:");
- for(int x=0;x<n.length;x++)
- System.out.print(n[x]+" ");
- }
- }
複製代碼 |