This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes k&b pp.502-503 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "k&b pp.502-503" Watch "k&b pp.502-503" New topic
Author

k&b pp.502-503

Ken Truitt
Ranch Hand

Joined: Aug 23, 2007
Posts: 124
This is question 8 in chapter 6 test;

Answer C, which is among the correct answers, is
Both Currency and NumberFormat objects must be constructed using
static methods.
While there is a Currency class, and there is a method getCurrency() in
NumberFormat which returns a Currency object, none of this is covered in
the book. Only getCurrencyInstance(), which is called on NumberFormat and
returns a nf obj appropriate for currencies, is presented in the material,
and even this does not directly reference a Currency object.

Nice to know that there is one, but is it going to be on the test?


SCJP 88% | SCWCD 84%
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Can you please post the question as well.

Not every one here has a copy of the SCJP study guide


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Ken Truitt
Ranch Hand

Joined: Aug 23, 2007
Posts: 124
Ok, here's k&b chapter 6 self test question #8:

Which are true? (Choose all that apply.)

A. The DateFormat.getDate() is used to convert a String to a Date instance.
B. Both DateFormat and NumberFormat objects can be constructed to be Locale specific.
C. Both Currency and NumberFormat objects must be constructed using static methods.
D. If a NumberFormat instance's Locale is to be different than the current Locale, it must be specified at creation time.
E. A single instance of NumberFormat can be used to create Number objects from Strings and to create formatted numbers from numbers.

On p. 514, answers B,C,D and E are listed as correct. My question regards
answer C, which I think is vague and misleading, given that the existence of a Currency object was not discussed, to my knowledge, in K&B and thus we
do not expect it to appear on the exam.

For my own peace of mind, I would like to verify that I got this question wrong because the test question tested a concept that was not presented in
the material. But beyond that, if Currency objects are going to be on the
exam, I want to know that too. Remember, we learned only about the NumberFormat.getCurrencyInstance() static method, which, strictly speaking,
returns a NumberFormat object, not a Currency object.
Ken Truitt
Ranch Hand

Joined: Aug 23, 2007
Posts: 124
Yeah so, can anybody answer my question?
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
Hi Ken,

you're right. The relevant stuff should be defined exactly: Classes, constructors, methods, exceptions, etc. It's annoying that sun limited the stuff in a rather vague way.

In the exam the situation improves, as you are told the number of correct answers: In your sample, for instance, you know B, C, E are definitely correct and you are not sure about D. But because you know 4 answers are correct, you would probably choose D, too.

Ralph


SCJP 5 (98%) - SCBCD 5 (98%)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: k&b pp.502-503
 
Similar Threads
NumberFormat Question
Parse method discrepancy of NumberFormat(CurrencyFormatter)
Doubt in K&B SCJP 5: topic Chapter 6
cannont resolve getIntegerInstance
NumberFormat parsing currency value failure