Hey Friends, the code is a simple example of using printstream class in Java:
Print.java
import java.io.*;
class Printstream {
 public static void main(String args[]) throws FileNotFoundException
 {
  PrintStream p=new PrintStream("File1.txt");
  p.println("Hello this is written to the file using print stream");
  p.println("Again the next line is also written to the file");
  System.out.println("\nData is successfully written to the file");
 }
}
Have Fun.............
03 Jan 2014

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.