Question: help! Run the FileClient with the debugger (with a breakpoint on the line with while). You'll need to create a file called input.txt in the
Run the FileClient with the debugger (with a breakpoint on the line with while). You'll need to create a file called input.txt in the src folder (which the program will open) and add some (any) contents to it. Expand the inputFile Scanner variable in the debugger window to check out its stored data. How much of it can you make sense of? Watch the values of keep looping, next word, and inputFileScanner's buf field in the debugger as you step through the loop multiple times. In your documentation, address the following: What do you think the Scanner's hasNext method does? Theorize about what the while statement does. Try to create a different while statement that does something else. Use this code as a reference import java.io.File; import java.util.Scanner; class FileClient public static void main(String] args) throws java.io.FileNotFoundException File input File = new File("src/input.txt"); Scanner inputFileScanner = new Scanner(inputFile); while ( inputFileScanner.hasNext()) System.out.println(inputFileScanner.next())
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
