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:
Verified
Q2: A _ is an object that has
Q3: Which of the following for loop headers
Q4: In a nested if statement an else
Q5: Which of the following expressions best represents
Q6: Let a and b be valid boolean
Q8: A logical expression can be described by
Q9: Every if statement requires an associated else
Q10: Which of the following logical operators has
Q11: In Java, a boolean expression is limited
Q12: A while statement always executes its loop
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents