Question: What do the following java statements do ? Scanner inputStream = null; try inputstream = new Scanner (new FileReader (autos.txt)); String line = inputstream.nextLine ();

What do the following java statements do ? Scanner inputStream = null; try inputstream = new Scanner (new FileReader ("autos.txt")); String line = inputstream.nextLine (); while (line != null) { System.out.println (line) ; line = inputStream.nextLine () ; } inputstream.close (); catch (FileNotFoundException e) { System.out.println ("Error opening files."); opens a file named autos.txt, reads the first line of the file and displays on the screen opens a file named autos.txt and displays each line in the file to the screen Only opens a file named autos.txt opens a file named autos.txt and writes to the file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
