PrintWriter is an abstract class for writing to character streams. Methods implement are write(char[], int, int), flush(), and close().Print formatted representations of objects to a text-output stream. This class implements all of the print methods found in PrintStream. It does not contain methods for writing raw bytes, for which a program should use unencoded byte streams.