Write a Java program to read a string and write it to a text file named “out.txt”.?
-
Please can someone help me in writing the java code as I don't have any clue as to how to write it Please help ASAP please!!!!!!!!!!! Thank you
-
Answer:
Wont give you the whole snippet,but here's the main part :) try { BufferedWriter out = new BufferedWriter(new FileWriter( "out.txt")); out.write(" Whatever you want to write !"); out.newLine(); out.write(" --------------------------------"); out.close(); } catch (IOException e) { System.out.println("Exception "); // Displays exception if try // failed }
Siddra at Yahoo! Answers Visit the source
Other answers
could you give the full coding please???? and what would the class be as you need to name the java file based on the class. thank you
Related Q & A:
- Is there a limit on the size of a new file or a text file?Best solution by Stack Overflow
- Does a cell phone send a DPS location when you send a text message?Best solution by Yahoo! Answers
- How to search for a particular string in a text file using java?Best solution by Stack Overflow
- How to write a TV program proposal?
- Is it bad if I play a mini DV tape on a camcorder that was recorded on a different camcorder?Best solution by friendsofhdvideo.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.