Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
I/O and Streams
Difference between printWriter.println("Sample"); and printWriter.write("Sample"); in Servlets
Bhaskar boddupalli
Greenhorn
Posts: 13
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Can some body please explain the difference between these two in
Servlets
.
PrintWriter printWriter = response.getWriter(); printWriter.println("Sample");
and
PrintWriter printWriter = response.getWriter(); printWriter.write("Sample");
Thanks.
Roger Sterling
Ranch Hand
Posts: 426
I like...
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
One appends a CR-LF, and one does not.
But of course, you could have read this for yourself, if you looked at the documentation :
"Terminates the current line by writing the line separator
string
.'
http://docs.oracle.com/javase/7/docs/api/java/io/PrintWriter.html
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Difference bet'n PrintWriter and FileWriter class.
servlet compilation
Java Plugin Problem 1.3.1_02
difference between PrintWriter.println and PrintWriter.write
PrintWriter.write(int c) Question
More...