Search the element

Report a typo

What will this code print?

    byte[] arr = {5, 2, 4, 1};
    byte key = 5;
    Arrays.sort(arr);

    System.out.println(Arrays.binarySearch(arr, key)); 
Enter a number
___

Create a free account to access the full topic