Page 1 of 1

Assume an object of the Scanner class called inputFile was declared and is going to be used to read from the "Names.txt"

Posted: Fri Jul 08, 2022 6:40 am
by answerhappygod
Assume An Object Of The Scanner Class Called Inputfile Was Declared And Is Going To Be Used To Read From The Names Txt 1
Assume An Object Of The Scanner Class Called Inputfile Was Declared And Is Going To Be Used To Read From The Names Txt 1 (53.09 KiB) Viewed 41 times
Assume an object of the Scanner class called inputFile was declared and is going to be used to read from the "Names.txt" file. If an IOException occurs, it should be caught and the error message should be printed to the console. Regardless of whether an Exception is caught or not, close the file. } } } { inputFile = new Scanner(new File("Names.txt")); inputFile.nextLine(); . (______ e) { System.out.println(e._ __0); { inputFile.close();