Question
In JAVA how do you open the file reading in each line as a String, store each String in an ArrayList. - If a FileNotFoundException
In JAVA how do you open the file reading in each line as a String, store each String in an ArrayList. - If a FileNotFoundException is thrown catch the exception and alert the user of the error. Find the alphabetic character that occurs the most in each sentence in the file, only consider alphabetic characters, treat lowercase and uppercase as the same character - For example if the input is "Hi how are you" the character H occurs twice - Assume that one alphabetic character will repeat more than the others - The sentence will only have one alphabetic mode. - Use the method findMode
(The main method cannot be set to throw any exceptions. The text file will contain multiple lines and each line will correspond to a single sentence.)
Sample Output:
Ex: If input is: anexample.txt
the output is:
Please enter the name of the file: The Character 0 occurs 5 times. The Character I occurs 5 times.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started