Home » JAVA Programming » Arrays » Question
  1. What is the output of this program?
    import java.util.*;
    public class ArrayExample
    {
    public static void main(String args[])
    {
    int arr[] = new int [10];
    for (int i = 10; i > 0; i--)
    arr[10 - i] = i;
    Arrays.sort(arr);
    System.out.print(Arrays.binarySearch(arr, 6));
    }
    }
    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
Correct Option: E

5



Your comments will be displayed only after manual approval.