wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in K&B SCJP 5: topic Chapter 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in K&B SCJP 5: topic Chapter 6" Watch "Doubt in K&B SCJP 5: topic Chapter 6" New topic
Author

Doubt in K&B SCJP 5: topic Chapter 6

Oliver Hernandez
Greenhorn

Joined: May 20, 2004
Posts: 10
In the self test for this chapter, question 8, I don't understand how "C." is a true statement:

C. Both Currency and NumberFormat objects must be constructed using static methods.


What is a Currency object?? The chapter doesn't cover such a class, except for getting a NumberFormat instance via the getCurrencyInstance() factory method. Is this a typo in the statement, that maybe should be reworded to something like "Both number and currency formatter objects must be constructed using static methods in the NumberFormat class"?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Oliver Hernandez:
...What is a Currency object?? The chapter doesn't cover such a class...

If you check the API documentation (which you should bookmark), you will see that the java.util.Currency class does not have any public constructors. Instead, it has static methods, getInstance(Locale locale) and getInstance(String currencyCode), both of which return a reference to an instance of Currency.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Oliver Hernandez
Greenhorn

Joined: May 20, 2004
Posts: 10
Thanks for the quick reply, as I'm studying like mad for the test this coming Thursday!

I did find that java.util.Currency class you mention, but that isn't on any of the SCJP5 objectives. What was even more frustrating in missing that question is that the chapter does not cover java.util.Currency.

I still believe the wording of this question is incorrect, and am hoping to hear from one of the authors here to clear me up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in K&B SCJP 5: topic Chapter 6
 
Similar Threads
Class and Object Problem
which is valid statement in this question
Bonus Master Exam issues
k&b pp.502-503
Objects during runtime