Which two (three?

Assuming the port statements are correct, which two (three?) code fragments create a one-byte file?
A. OutputStream fos = new FileOutputStream(new File("/tmp/data.bin"));
OutputStream bos = new BufferedOutputStream(fos);
DataOutputStream dos = new DataOutputStream(bos); dos.writeByte(0); dos.close();
B. OutputStream fos = new FileOutputStream ("/tmp/data.bin");
DataOutputStream dos = new DataOutputStream(fos); dos.writeByte(0); dos.close();
C. OutputStream fos = new FileOutputStream (new File ("/tmp/data.bin"));
DataOutputStream dos = new DataOutputStream(fos); dos.writeByte(0); dos.close();
D. OutputStream fos = new FileOutputStream ("/tmp/data.bin"); fos.writeByte(0); fos.close();

Download Printable PDF. VALID exam to help you PASS.

One thought on “Which two (three?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.