Question: //JAVA// im new to reading files and for this program i need to read in my file and i have to find the most repeated

//JAVA// im new to reading files and for this program i need to read in my file and i have to find the most repeated word or integer and do not do any throws on the main method
//JAVA// im new to reading files and for this program i need

public static void main(String[] args) \{ I/ TOD0 Auto-generated method stub Scanner str = new Scanner(System.in); String filename= str. nextLine(); try \{ ArraylisteString>input=getMode(filename); System.out. println(input); \} catch(FileNotFoundException e) \{ System.out.println("No file"); 3 public static ArraylisteString getinput(String filename) throws FileNotFoundException\{ Arraylist> input = new Arraylist (); File file = new File(filename); Scanner in = new Scanner(file); while(in.hasNextLine()) \{ input. add (in.nextline()); \} in. close(); return input; 3 public static Arraylist getMode(String filename) \{ String oldname=" "; 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!