• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between out.print() and out.println()

 
Akash Shankar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!!

Me newbie. Can anybody tell me whas the diff b/w out.print() and out.println().
Thanx in advance
Akash
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
println() prints a newline character at the end of whatever you tell it to print, print() does not.
As browsers skip newline characters (unless in pre text) there's not much you'll gain from using it except that the generated html will be easier to read by humans (and maybe some browsers) at the cost of more network traffic.
 
Akash Shankar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!