Reading Data from Text File
In Section 2.5, you learned how to use a Scanner object to input data from the standard input device (keyboard). Recall that the following statement creates the Scanner object console and initializes it to the standard input device: Scanner console = new Scanner(System.in); You can also use the Scanner class to read input from a file….