Java PrintStream significance and where to use this?

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?
Working with PrintStream
Advertisements
where exactly we use interface and where abstract class?
Interview Questions - Where Java is used?
Where to take online Java Training?
why and where we use setter and getter methods in java, please give me one example program.....
Where to learn java programming language
Where i can use UNIX Operating System?
What are POJOs and what’s their significance?
Where should I use Hibernate framework?
Where should I use Hibernate framework?
Where should I use Hibernate framework?
How to find java jobs at any where in india
Significance of Linux
Where can I learn Java Programming
Where can I start learning how to use TensorFlow?
how to use comma separated value list in the where clause oracle
HOW CN I USE WHERE AND BETWEEN CLAUSE SIMULTANEOUSLY... IN MYSQL
Java Compiler
Where can I start learning how to use TensorFlow?
Where can I find the best core java tutorial online?
Where can I find the best core java tutorial online?
Java Compiler,Java Compiler Example
where to stroe this uploaded file
where this file is stored
Where clause
where is the definition of keywords like this, int, void present in Java ? e.g the definition of methods are in API.
Hibernate WHERE Clause
JDBC: WHERE Clause Example
how to store multiple values from drop down in database where i am using java struts 1.3
Php Sql Where

Ads