How would you find the most occurring words in a file that has five or more letters using an input/output program? This is a starter code that i have
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();
}
}