Java PrintStream significance and where to use this?

Ads
 

Java PrintStream significance and where to use this?

I found many programmers using PrintStream in their codes. I looked for this,but failed to get the clear idea of its significance,Why to use it?

"Unlike other output streams, a PrintStream never throws an IOException and the data is flushed to a file automatically i.e. the flush method is automatically invoked after a byte array is written."

So what's the benefit if flush is automatically invoked?

private PrintStream x = null;

Now what could be the possible reasons if someone declares x like this?

View Answers

June 17, 2013 at 12:25 PM

hi friend,

PrintWriter class prints the characters rather than the bytes whereas, PrintStream class prints the characters into bytes. Characters are converted into byte using default character encoding.

For reading more in detail you may go through the following link, may this will be helpful for you.

Java Print Stream

Thanks.

Ads









Related Tutorials/Questions & Answers:
Java PrintStream significance and where to use this?
Where to use ServiceImpl - Development process
Advertisements
why and where we use setter and getter methods in java, please give me one example program.....
Working with PrintStream
where exactly we use interface and where abstract class?
Explain the use of the ‘LIKE’ keyword used in the WHERE clause?
Explain the use of the ‘LIKE’ keyword used in the WHERE clause?
Where i can use UNIX Operating System?
Where should I use Hibernate framework?
where to start - Java Beginners
Interview Questions - Where Java is used?
how to use comma separated value list in the where clause oracle
HOW CN I USE WHERE AND BETWEEN CLAUSE SIMULTANEOUSLY... IN MYSQL
Where to take online Java Training?
Where to learn java programming language
What are POJOs and what’s their significance?
Java Compiler,Java Compiler Example
Java Use cases
How to find java jobs at any where in india
Explain the use of the ?LIKE? keyword used in the WHERE clause? Explain wildcard characters in SQL.
Explain the use of the ‘LIKE’ keyword used in the WHERE clause? Explain wildcard characters in SQL.
where located mysql jar file - Java Beginners
where singleton class used in java - Java Interview Questions
Significance of Linux
What is the use of Java?
How to use Sigma grid built-in capabilities to calculate aggregates where Sortable property set to TRUE
Where can I learn Java Programming
Java Compiler
Image is in same folder where the java file is located - Swing AWT
Where can I find the best core java tutorial online?
Hibernate WHERE Clause

Ads