Solved

Suppose We Wanted to Process a Text File Called "Input

Question 15

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