ISBN 0-7821-2826-2 Sybex - Philip Heller Page 83 -> Sample Question Which of the following Java primitive types can express negative numbers? A boolean B byte C char D float E long Answer: B,C,D. The boolean type is not numeric. The char type can only take zero and positive values. Wrong, it must be answer B,D,E or? Chris
On second thought, the question asks which ... can *express* negative number. So I think the answer are B, D, E, and C. Since people can use unicode to express negative number.
Wouldn't that require at lease two characters--one character for the negative sign followed by one or more numeric characters?
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Joined: Aug 05, 2001
Originally posted by Chris Lenz: Which of the following Java primitive types can express negative numbers? A boolean B byte C char D float E long
I see you have a point. But the question asks which primitive *type* can express negative number? So my understanding is it is not limited to one character. If the question asks which primitive type *variable* can express negative number? then you are defintely correct.