• Post Reply Bookmark Topic Watch Topic
  • New Topic

PrintWriter out.println() or System.out.println() - which gives better perfromance ?  RSS feed

 
Oni Anand
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

my question is which is better -
PrintWriter out.println() or System.out.println() - which gives better perfromance ?
tx
AA
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java's output stream is a Printwriter object. When you call System.out you are using the PrintWriter so, the performance is the same.

------------------
Hope This Helps
Carl Trusiak
 
maateen ashraf
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if we are concerned with perfomance then no differance...
but
the only difference is at programing level
System.out is static object of printWriter

 
Oni Anand
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot. that was real helpful
Anand
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!