Why do I get the error “File cannot be resolved to a type”?

后端 未结 4 1728
天涯浪人
天涯浪人 2020-12-10 17:26

Here\'s part of my code

try{

    BufferedReader in= new BufferedReader(new InputStreamReader(System.in));

    while ((line= in.readLine())!=\"exit\"){

            


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-10 18:05

    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.

提交回复
热议问题