Hi guys , I dont have idea on how to solve this problem . I attach my question but I dont know whether it is true or not.
Can you please help me
Given an output file named "data.txt" write the code fragment to
i ) set up the file and output stream ii) write the value of 101 to the stream iii) close the stream
My Answer :
i) import java.io.*; File outFile = new File ("data.txt"); FileOutputStream outFileStream = new FileOutputStream(outFile); PrintWriter outStream = new PrintWriter(outFileStream); ii) outStream.println(“101”); iii) outStream.close();