提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
排序双数组
import java.util.Arrays; /*from 时 代 Java - nowjava.com*/ public class Main { public static void main(String[] args) { double[] d1 = new double[]{3,2,5,4,1}; System.out.print("Original Array :\t "); for(int index=0; index < d1.length ; index++) System.out.print(" " + d1[index]); //To sort full array use sort(double[] d) method.// 来自 NowJava.com - 时代Java Arrays.sort(d1); System.out.print("\nSorted double array :\t "); for(int index=0; index < d1.length ; index++) System.out.print(" " + d1[index]); double[] d2 = new double[]{5,2,3,1,4}; Arrays.sort(d2,1,4); //print sorted double array System.out.print(