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 =

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!