Solved

Consider the Following Code Snippet: File InputFile = New File("input

Question 83

Multiple Choice

Consider the following code snippet: File inputFile = new File("input.txt") ;
You wish to read the contents of this file using a Scanner object. Which of the following is the correct syntax for doing this?


A) Scanner in = Scanner ("input.txt")
B) Scanner in = new Scanner ("input.txt")
C) Scanner in = Scanner.open(inputFile)
D) Scanner in = new Scanner(inputFile)

Correct Answer:

verifed

Verified

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

Related Questions