Question: This program is expected to read from a file called Input.txt, that contains three lines of text and displays them. These lines are: This is
This program is expected to read from a file called "Input.txt", that contains three lines of text and displays them. These lines are: This is the first line This is the second line This is the third line Unfortunately, it does not work. Debug the program and rewrite the correct code. import java.util.. import java.io. public class readFile{ public static void main(String args) { Scanner input - new Scanner("Input.txt"); while (input hasNextLine()){ String line- input.next(); System.out.println(line): 3 Edit View Insert Format Tools Table
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
