猿问

异常:System.IO.FileNotFoundException: 未能找到文件该怎么处理??

import java.util.Scanner;

import java.io.*;


public class ReadData{

public static void main(String[] args) throws Exception{

File file = new File("score.txt");

Scanner in = new Scanner(file);

while(in.hasNext()){

String firstname = in.next();

String mi = in.next();

String last = in.next();

System.out.println(firstname+" "+mi+" "+last+" ");

}

in.close();

}

}



icegxy
浏览 5232回答 1
1回答

Wang_Yu

异常已经提示的很明显了啊。。是不是没有score.txt这个文件
随时随地看视频慕课网APP

相关分类

Java
我要回答