Valid 1Z0-804 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-804 Exam! ExamDiscuss.com now offer the newest 1Z0-804 exam dumps, the ExamDiscuss.com 1Z0-804 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-804 dumps with Test Engine here:
Assuming the port statements are correct, which two (three?) code fragments create a one-byte file?
Correct Answer: A,B,C
Explanation/Reference: Explanation: B:Create DataOutputStream from FileOutputStream public static void main(String[] args) throws Exception { FileOutputStream fos = new FileOutputS tream("C:/demo.txt"); DataOutputStream dos = new DataOutputStream(fos); Note: The FileOutputStream class is a subclass of OutputStream. You can construct a FileOutputStream object by passing a string containing a path name or a File object. You can also specify whether you want to append the output to an existing file. public FileOutputStream (String path) public FileOutputStream (String path, boolean append) public FileOutputStream (File file) public FileOutputStream (File file, boolean append) With the first and third constructors, if a file by the specified name already exists, the file will be overwritten. To append to an existing file, pass true to the second or fourth constructor. Note 2:public class DataOutputStream extends FilterOutputStream implements DataOutput A data output stream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in. Reference:java.io Class DataOutputStream