PrintStream (Java Platform SE 7 ) - docs.oracle.com.
Java IO contains many subclasses of the InputStream, OutputStream, Reader and Writer classes. The reason is, that all of these subclasses are addressing various different purposes. That is why there are so many different classes. The purposes addressed are summarized below: File Access; Network Access; Internal Memory Buffer Access.
PrintStream An output stream with convenient printing methods.. And the Rest. In addition to the stream classes, java.io contains these other classes: File Represents a file on the native file system. You can create a File object for a file on the native file system and then query the object for information about that file (such as its full pathname). FileDescriptor Represents a file.
So far the two methods, print and println (),that have been used for displaying the primitive data type, object, etc. on an output device are defined by the PrintStream class. This is a byte stream class which is derived from the Output Stream class. Unlike other output streams, the PrintStream class does not throw an IOException even if an exceptional event occurs.
There are classes specifically meant for reading character streams such as Reader and Writer. Before an application can use a data file, it must open the file. A Java application opens a file by creating an object and associating a stream of bytes with that object. Similarly, when you finish using a file, the program should close the file.
Java.io.PrintStream.println(Object x) Method - The java.io.PrintStream.println() method prints an Object and then terminate the line. This method calls at first String.valueOf(x) to get the printed object's.
Java File Class. The File class is an abstract representation of file and directory pathname. A pathname can be either absolute or relative. The File class have several methods for working with directories and files such as creating new directories or files, deleting and renaming directories or files, listing the contents of a directory etc.
File file new File datatxt PrintStream ps new PrintStreamfile save data to a from CSCI 1530 at The Chinese University of Hong Kong.