Writer.java: import java.io.*; class Bufferedwriter { public static void main(String args[]) throws IOException { String s="Hello this information is written to file using filewriter\nIt is used for writting"; FileWriter f=new FileWriter("File1.txt"); char b[]=new char[s.length()]; s.getChars(0,s.length(),b,0); BufferedWriter bw=new BufferedWriter(f); bw.write(b); f.close(); System.out.println("Data Successfully Written"); } }Have Funs..............
Related Posts
Add JTree programmatically in Java Swing
JTree: A tree is a component that presents a hierarchical view of data. The user has the ability to...Read more
Add JTable Programmatically in Java
JTable: JTable is a component that displays rows and columns of data. We can drag the cursor on co...Read more
Creating Number Guesser in JSP
Hello friends this is a simple program of creating a number guesser in JSP....Have a look... <...Read more
FileOutputStream in Java
Hello Friends.....this is the code for using FileOutputStream in Java: Stream.java: import java....Read more
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment
Note: only a member of this blog may post a comment.
Click to see the code!
To insert emoticon you must added at least one space before the code.