我正在尝试读取文件。就我的代码而言,我有这个
public static File readFileInfo(Scanner kb)throws FileNotFoundException
{String fileName;
System.out.print("enter file name: ");
fileName = kb.nextLine();
file infile = new file(filename)
Scanner fin = new Scanner(inFile);
return fin
我得到这个错误代码
FileUtil.java:23: incompatible types
found : java.util.Scanner
required: java.io.File
从这里开始,我有点迷失了,任何帮助都会很棒!多谢你们!