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?
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.
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.