SCJP Module-10 Question-9

The given Sample program will test your understanding about the opening a file in Java and writing data into it.

 
 

Share on Google+Share on Google+

SCJP Module-10 Question-9

Ads

The given Sample program will test your understanding about the opening a file in Java and writing data into it.

Re-arrange the code for writing into a text file.

(1) place code here = new FileWriter("out.txt");
(2) place code here out = new (3) place code here
out.write("Hello Java");
out.close();

Select the sequence of code from the given sentences for proper execution of above code.

(X) FileWriter fstream
(Y) BufferedWriter
(Z) BufferedWriter(fstream);

Options:

(A) 1-X, 2-Y, 3-Z
(B) 1-X, 2-Z , 3-Y 
(C) 1-Z, 2-X, 3-Y

Answer:

(A)

Advertisements

Posted on: July 17, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles