Exceptions help

Im making a program which allows the user to input a file name. If the file name does not match the file to be found (ints10.txt) then the program will tell the user the file does not exist. The program will continue until the user gets the right filename. Then it will say you found the file.

WHAT is wrong with my code:

import java.util.*;

public class Exceptions{

public static void main(String[] args) {

Scanner in = new Scanner(System.in);

boolean answer = ints10.txt;

while (answer !=ints10.txt) {

try {

System.out.println("Enter the file name");

answer = in.nextBoolean();

}

catch (FileNotFoundException) {

in.nextLine();

System.out.println("Input was the correct file.");

}

}

System.out.println ("You found the file.");

}

}

[855 byte] By [Bigfoot245a] at [2007-11-27 8:29:17]
# 1
Well, this doesn't mean anything and isn't syntactically correct:boolean answer = ints10.txt;
paulcwa at 2007-7-12 20:19:32 > top of Java-index,Java Essentials,Java Programming...