Solved

Suppose We Wanted to Process a Text File Called "Input

Question 7

Multiple Choice

Suppose we wanted to process a text file called "input.txt" using the Scanner object. Which of the following lines of code correctly creates the necessary Scanner object?


A) Scanner inputFile = new Scanner("input.txt") ;
B) Scanner inputFile = new Scanner(new InputFile("input.txt") ;
C) Scanner inputFile = new Scanner(new File(input.txt) ;
D) Scanner inputFile = new Scanner(new InputFile(input.txt) ;
E) Scanner inputFile = new Scanner(new File("input.txt") ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents