Here\'s part of my code
try{
BufferedReader in= new BufferedReader(new InputStreamReader(System.in));
while ((line= in.readLine())!=\"exit\"){
Chances are you've just missed:
import java.io.File;
from the top of your source file.
You could use
import java.io.*;
I typically use single-type imports.
You most likely forgot to import java.io.File but essentially the compiler is telling you it can't find the "File" class.
See this java error page specific to "File cannot be resovled to a type" for more info.
I received this error once, even though I had already imported java.io.File. I think it was some weird, temporary Eclsipse glitch. When I made other changes to the code, then saved it again, the error resolved itself.
You need to include either
import java.io.File;
or
import java.io.*;
at the top of your source file.