Examveda

What will be the output of the given Java code?
import java.util.Arrays; 
public class SortExample 
{ 
	public static void main(String[] args) 
	{ 
		int[] arr = {10,7,9,5,8,4}; 
		Arrays.sort(arr, 1, 3); 
		System.out.printf(Arrays.toString(arr)); 
	} 
}

A. [4,5,7,8,9,10]

B. [10,9,8,7,5,4]

C. [10,5,7,8,9,4]

D. [10,7,9,5,8,4]

Answer: Option D


This Question Belongs to Data Structure >> Sorting Algorithms

Join The Discussion

Related Questions on Sorting Algorithms