how to use printwriter class..
The PrintWriter Class
Although using System.out to write to the console is acceptable, its use is recommended mostly for debugging purposes or for sample programs. Java is through a PrintWriter stream. PrintWriteris one of the character-based classes.Using a character-based class for console output makes it easier to internationalize your program. PrintWriter supports the print( ) and println( ) methods for all types including Object.