- 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 40 times
Assume an object of the Scanner class called inputFile was declared and is going to be used to read from the "Names.txt"
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Assume an object of the Scanner class called inputFile was declared and is going to be used to read from the "Names.txt"
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();