Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

k&b pp.502-503

 
Ken Truitt
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please post the question as well.

Not every one here has a copy of the SCJP study guide
 
Ken Truitt
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah so, can anybody answer my question?
 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic