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
Q23: The _ loop is ideal in situations
Q24: What will be the value of x
Q25: Which of the following is the method
Q26: If a loop does not contain, within
Q27: In all but very rare cases, loops
Q29: What will be the value of x
Q30: What will be the value of x
Q31: What will be the value of x
Q32: Given the following statement, which statement will
Q33: What will be the values of x
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