Section-C (Choose the correct Answers) (1 x 2 = 2 4. Program to create a file using file writer in Blue-J. [str, si impo

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Section-C (Choose the correct Answers) (1 x 2 = 2 4. Program to create a file using file writer in Blue-J. [str, si impo

Post by answerhappygod »

Section C Choose The Correct Answers 1 X 2 2 4 Program To Create A File Using File Writer In Blue J Str Si Impo 1
Section C Choose The Correct Answers 1 X 2 2 4 Program To Create A File Using File Writer In Blue J Str Si Impo 1 (39.3 KiB) Viewed 74 times
Section-C (Choose the correct Answers) (1 x 2 = 2 4. Program to create a file using file writer in Blue-J. [str, si import java.io.FileWriter; import java.io. [OlException, IOException] public class CreateFile { public static void main(String[] args) throws IOException { // Accept a string String = "File Handling in Java using "+" File Writer and FileReader"; // attach a file to File Writer File Writer fw= FileWriter("output.txt"); [old, new] // read character wise from string and write // into FileWriter for (int i = 0; i < str.length(); i++) fw.write(str.charAt(i)); System.out.println("Writing successful"); //close the file fw. LO; [open, close] } }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply