On the practice
test for Qhizlabs
SCJA Prep Kit, question 2 asks:
Which of the given option is not a primitive wrapper class?
A. Number
B. Char
C. Byte
D. Short
E. Boolean
Now I'm sure that we all know that the answer is B, as the wrapper class for char is Character, not Char. However, the explination is unclear and could be misleading, depending on how the question could appear on the actual exam. The explanation is:
The primitive wrapper classes in Java are Number, Integer, Character, long, Float, Double, Byte, Short, and Boolean. Except for Character, all the other types have the same name as the corresponding primitive data type with the starting letter uppercased. For the primitive type char, the equivalent wrapper class is Character.
I've bolded the line that I believe could be clarified. While Character is different, so is the Integer wrapper since it goes with int. When I first read this sentence it seemed to me that the author had overlooked the Integer wrapper, but then I thought perhaps they were just referring to the wrappers that are provided as answers (which does not include Integer). If read in that mindset then the sentence does make more sense.
Just bringing this to everyone's attention, in case you are using the kit also and didn't dig into it!