Sort sub long array in Java
Description
The following code shows how to sort sub long array.
Example
//w ww . j ava2 s .c o m
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
long[] l2 = new long[] { 5, 2, 3, 1, 4 };
Arrays.sort(l2, 1, 4);
for (long l: l2){
System.out.print(" " + l);
}
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »