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?
why and where we use setter and getter methods in java, please give me one example program.....
Advertisements
where exactly we use interface and where abstract class?
Where i can use UNIX Operating System?
Where should I use Hibernate framework?
Where should I use Hibernate framework?
Where should I use Hibernate framework?
Working with PrintStream
Where can I start learning how to use TensorFlow?
Interview Questions - Where Java is used?
Where to take online Java Training?
Where to learn java programming language
how to use comma separated value list in the where clause oracle
HOW CN I USE WHERE AND BETWEEN CLAUSE SIMULTANEOUSLY... IN MYSQL
Where can I start learning how to use TensorFlow?
What is the use of Java?
Java Compiler,Java Compiler Example
How to find java jobs at any where in india
making use java image filters
Java Compiler
Where can I learn Java Programming
list of predeined methods and use java
How to use charAt() method in Java?
How to create and use Array in Java?
What are POJOs and what’s their significance?
How to use Sigma grid built-in capabilities to calculate aggregates where Sortable property set to TRUE
What is the real use of Java Program
What is the real use of Java Program
is it possible to use jsp in java script
is it possible to use jsp in java script
What is the use of Hibernate Framework in Java

Ads