• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

k&b pp.502-503

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah so, can anybody answer my question?
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic