Question: Given that the file is a File object, which of the following are legal statements to create a new file? (i) file.create(); (ii) FileOutputStream fos

Given that the file is a File object, which of the following are legal statements to create a new file?

(i) file.create();

(ii) FileOutputStream fos = new FileOutput Stream(file);

(iii) FileWrter out = new FileWriter(file);

(iv) FileInputStream fis = new FileInput Stream(file);

(v) RandomAccessFile raf = new Random AccessFile(file);


(a) (ii), (iii) and (iv)

(b) (ii), (iv) and (v)

(c) (ii) and (iii)

(d) (ii), (iii) and (v)

Step by Step Solution

3.49 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

d ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Advanced Java Programming Questions!