Question: CHALLENGE ACTIVITY 3 . 4 . 1 : File input. 5 2 2 5 6 2 3 5 7 8 1 9 4 quazid? Jump
CHALLENGE
ACTIVITY
: File input.
quazid?
Jump to level
String fileName is assigned a file's name read from input. The file is opened as a FilelnputStream named peopleStream, and Scanner inFS may be used to read the file. Perform the following tasks:
Assign authorName with the first string read from the file.
Output the value of authorName followed by a newline.
Close the file.
Click here for example
tableAuthorDataReaderjavaintxtintxtintxtintxtintxt
import java.util.Scanner;
import java.ioFileInputStream;
import java.ioIOException;
public class AuthorDataReader
public static void mainString args throws IOException
Scanner scnr new Scanner
System.in;
String fileName;
String authorName;
FileInputStream peopleStream null;
Scanner inFS null;
fileName scnr next;
peopleStream new FileInputStreamfileName;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
