The moose likes I/O and Streams and the fly likes PrintWriter Purpose Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "PrintWriter Purpose" Watch "PrintWriter Purpose" New topic
Author

PrintWriter Purpose

Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 512
What exactly is the purpose of PrintWriter? What can it do that other classes can't do?
Dale


By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Steve Deadsea
Ranch Hand

Joined: Dec 03, 2001
Posts: 125
It does not do much that a Writer does not do. Both Writers and PrintWriters accept Strings as input. PrintWriter has methods called print() and println() that are similar to those methods in PrintStream. PrintWriter is mainly meant for people who are upgrading their character streams from PrintStreams (8-bit) to Writers (16-bit) so that they can use the same API.
 
 
subject: PrintWriter Purpose
 
Threads others viewed
PrintWriter append
String x = "hi" ; garbage collected ?
Differences
life
Dbt on ServletOutputStream
IntelliJ Java IDE