Binary search is an algorithm that locates a value in an ordered data set by repeatedly halving the data to smaller sets. This is called "divide and conquer" and can be accomplished either with a simple loop or recursion.

This algorithm is very fast, however the data must have been ordered before.

Here's an example that uses recursion to find the index of a value in an integer array:

```	/**
* Demonstration of a binary search
*/
public class App {

private static int ordArray[] = {2,4,6,9,11,12,15,18,21,24,30,31};

public static void main(String[] args) {

int index = binarySearch(0, ordArray.length - 1, 18);

if (index == -1)
else
System.out.println("Search value found at index " + index);
}

/**
* Searches a value into an ordered array and returns its index, using
* binary search and recursion
*/
public static int binarySearch(int first, int last, int searchVal) {

// finds the middle index of the sub-array
int middle = (first + last) / 2;

if (searchVal == ordArray[middle]) {
// Value found, return the index
return middle;
}
else if (last < first) {