Solved

Which Line Completes This Code Fragment to Define a Text

Question 1

Multiple Choice

Which line completes this code fragment to define a text file named txtfile for reading? ____________________________________________________
String line = scan.nextLine() ;


A) Reader scan = new Reader(new File("txtfile") ) ;
B) FileReader scan = new File("txtfile") ;
C) Scanner scan = new Scanner(System.in) ;
D) Scanner scan = new Scanner(new File("txtfile") ) ;

Correct Answer:

verifed

Verified

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents