Binary Search Feedback I have written a binary search algorithm, but it seems to be a bit different than other peoples that I've seen. I was hoping that the community could give me some feedback as to whether or not I'm missing something, or doing something the wrong way. 

Binary Search: 

import java.util.Arrays; 

public class BinarySearch {

    public int[] numbers = new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}; 

    /**
     * @param num
     * @param key
     * 
     * Function recursively searches sorted array of integers, finding the specific number (key).
     * Search looks at the midpoint of array, checking to see if midpoint is number being sought,
     * if not, depending of whether the sought number is greater than, or less than, the midpoint
     * the function copies the upper, or lower, half of the array and passes it into a recursive 
     * function call.
     * 
     */
    public int performSearch(int[] num, int key){
        if(num.length == 0){
            System.out.println("Array empty"); 
            return 0; 
        }else{
            int mid; 
            int number=0; 
            mid = (num.length)/2; 
            if(key == num[mid]){
                number =  num[mid]; 
                System.out.println("Found the number " + number); 
                return number; 
            }else if((key &lt; num[mid]) &amp;&amp; num.length &gt; 1){
                num = Arrays.copyOfRange(num, 0, mid); 
                System.out.println("Low Range: " + Arrays.toString(num)); 
                return performSearch(num, key); 
            }else if((key &gt; num[mid]) &amp;&amp; num.length &gt; 1){
                num = Arrays.copyOfRange(num, mid, num.length); 
                System.out.println("High Range: " + Arrays.toString(num)); 
                return performSearch(num, key); 
            }else{
                System.out.println("Number does not exist in array."); 
                return 0; 
            }
            //return number; 
        }

    }

    /**
     * @param args
     */
    public static void main(String[] args) {
        int key = 22; 
        BinarySearch bs = new BinarySearch(); 
        int index = bs.performSearch(bs.numbers, key); 
        System.out.println("Number " + index);
    }

}
I see 1 bug, 1 problem and 1 minor thing:


as listed in the comment above: You are returning the number instead of the index. That's not very helpful for a binary search algorithm ;)
when the array does not contain the item you are returning 0. 0 is a valid array index, by convention you'd return -1 in that case.
not much of a problem but unnecessary: local variable number in first else block is obsolete.