您如何使用输入/输出程序找到包含五个或更多字母的文件中出现次数最多的单词?这是我拥有的入门代码
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
public class FileIOtest {
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
File file = new File ("myfile.txt");
Scanner inputFile = new Scanner(file);
while(inputFile.hasNext())
{
String str =inputFile.nextLine();
System.out.println(str);
}
inputFile.close();
}
}