Multiple Choice
Which of the following statements opens a file named MyFile.txt and allows you to read data from it?
A) Scanner inputFile = new Scanner("MyFile.txt") ;
B) File file = new File("MyFile.txt") ;
Scanner inputFile = new Scanner(file) ;
C) File Scanner = new File("MyFile.txt") ;
D) PrintWriter inputFile = new PrintWriter("MyFile.txt") ;
Correct Answer:

Verified
Correct Answer:
Verified
Q16: The while loop is always the best
Q17: The _ loop is ideal in situations
Q18: How many times will the following do-while
Q19: What will be the values of x
Q20: In the following code, what values could
Q22: The _ loop is ideal in situations
Q23: In a for loop, the control variable
Q24: The do-while loop must be terminated with
Q25: The do-while loop is ideal in situations
Q26: Select all that apply. Which of the