Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

sort array from certain index java

import java.util.Arrays;
 
public class Example2 {
    public static void main(String[] args) {
        int arr[] = {2, 14, 5, 8, 7, 9, 0};
        int fromIndex = 1;
        int toIndex = 4;
        Arrays.sort(arr, fromIndex, toIndex);
        System.out.println(Arrays.toString(arr));
    }
}
 
PREVIOUS NEXT
Tagged: #sort #array #index #java
ADD COMMENT
Topic
Name
2+4 =