This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What is the output of printf? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What is the output of printf?" Watch "What is the output of printf?" New topic
Author

What is the output of printf?

Henry Zhi Lin
Ranch Hand

Joined: Nov 04, 2008
Posts: 69
This is from exam lab,



what is the output of this, and could you explain it?


SCJP 5.0
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19061
    
  40

This is from exam lab,



BTW, what is "exam lab"? Please provide more detail on this source.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14430
    
  23

Did you try compiling and running it in a small test program? What is the output? Can you explain it yourself? Have a look at the API documentation for the printf() method in java.io.PrintStream for information on how printf() works.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Henry Zhi Lin
Ranch Hand

Joined: Nov 04, 2008
Posts: 69
Originally posted by Henry Wong:



BTW, what is "exam lab"? Please provide more detail on this source.

Henry


This is from the new SCJP simulator which I download from www.examlab.tk
Henry Zhi Lin
Ranch Hand

Joined: Nov 04, 2008
Posts: 69
Originally posted by Jesper Young:
Did you try compiling and running it in a small test program? What is the output? Can you explain it yourself? Have a look at the API documentation for the printf() method in java.io.PrintStream for information on how printf() works.


Sorry, I may just want a quick answer from someone, in fact whenI looked the http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html page, I do understand why and how to get the output.

Thanks for your not so easy answer!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the output of printf?