Why isn't this variable being recognized in my loop. Its both initialized and local?

boolean match = false;
int[] Question6Array = new int[20];
Random rand = new Random();
for (int i =0; i < Question6Array.length; i++){
    Question6Array[i] = rand.nextInt(100) + 1;

Scanner scanner = new Scanner(System.in);
System.out.println("What Number would you like to Search for?");
int userInput = scanner.nextInt();

for (int i = 0; i < Question6Array.length; i++){
    if ( Question6Array[i] == userInput){
        System.out.println("Match Found");
        match = true;

for some reason match is not being recognized in my for loop at the bottom. I'm trying to set a ticker variable so that once its been set to true I can write a statement based on whether it's true or false.