This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Console IO

 
vivek dhiman
Ranch Hand
Posts: 152
Netbeans IDE Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

Please tell me what is the difference between printf() and print() function. Which one is better to use any why?

Thanks.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neither is a function. You can find out about printf here, about print() here and about what you thought you were asking about here.
 
vivek dhiman
Ranch Hand
Posts: 152
Netbeans IDE Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its helpful. Thanks a Lot.

But still confused about format() and printf() function. If possible give some short example.

 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What format and printf function? They are neither of them functions.

Actually, if you are thinking of the same format and printf methods I am thinking of, says what the difference is in the documentation.
 
Rahul mir
Ranch Hand
Posts: 38
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
printf is generally used for formatted output

printf("format string", argument(s));

print is use for simply displaying output.



  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic