Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started