I am trying to validate password and username using array and the array.BinarySearch function. The first two user names in the array: bradley and john are returning the correct
A binary search requires the array to be sorted before hand. You can either list the names in order, or perform the sorting yourself. You can use Arrays.sort(names) to sort the array of names.