Java Code Example: searchs an array for a number

In this code example an array is searched for a number.

import java.util.Scanner;

public class SearchNumberInArray {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int number, i;
		boolean numberInArray = false;
		int numbers[] = {65, 35, 23, 75, 76, 33, 12, 9};

		System.out.print("What number are you looking for? " );
		number = reader.nextInt();
			
		// loop over array and search for number
		for(i = 0; i < numbers.length; i++) {
			if(number == numbers[i]) {
				numberInArray = true;
				break;
			}
		}
	
		// if boolean varible numberInArray is true ouput "found", 
		// if not output "not found"
		System.out.println("Number " + number + (numberInArray ? " found" : " not found") + " in Array!");
	}
}
Output
What number are you looking for? 9
Number 9 found in Array!