*
The moose likes Mock Exam Errata and the fly likes Failure in book Java 2 Exam Notes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "Failure in book Java 2 Exam Notes" Watch "Failure in book Java 2 Exam Notes" New topic
Author

Failure in book Java 2 Exam Notes

Chris Lenz
Greenhorn

Joined: Feb 19, 2003
Posts: 5
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
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
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 think the answer are B,D,E.
boolean only takes 'true' and 'false'
char only takes positive.
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
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

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.
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Originally posted by Don Liu:

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>
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Failure in book Java 2 Exam Notes
 
Similar Threads
WHIZlabs scjp 1.4 simulator error?
Numerice value for letter 'a'
Doubt in Array
Switch statement
Thread yielding