The best answer is the XOR operator. Just for fun another way is, if you are allowed to sort the array, to sort it and compare adjacent integers. This assumes all integers appear exactly twice with one integer appearing once.
// Random array of integers
int[] arr = {1, 2, 3, 4, 5, 6, 7, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9};
// Sort the array.
Arrays.sort(arr);
// Array now looks like: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 9 9
// Cycle through array comparing adjacent values.
for(int i = 0; i < arr.length; i++){
// This would mean the single number was the last element in the array.
if(i == arr.length-1)
singleNum = arr[i];
// If the adjacent elements are the same, skip foward.
if(i < arr.length-1 && arr[i] == arr[i+1])
i ++;
else
// Otherwise, you found the single number.
singleNum = arr[i];
}