File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in K&B SCJP 5:  assert and boxing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in K&B SCJP 5:  assert and boxing" Watch "Doubt in K&B SCJP 5:  assert and boxing" New topic
Author

Doubt in K&B SCJP 5: assert and boxing

Cindy Rogers
Ranch Hand

Joined: May 17, 2006
Posts: 31
p 373 (in section "Assertion Expression Rules"): "The first expression must always result in a boolean value!"

p 375 (in Exam Watch box): "An assert expression must result in a boolean value, true or false?"


I found that boxing applies to asserts; that is, the first expression may be a boolean or a Boolean.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Cindy Rogers:
...I found that boxing applies to asserts; that is, the first expression may be a boolean or a Boolean.

That's correct...


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
To be pedantic, the Boolean wrapper object is unboxed to a boolean primitive value.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in K&B SCJP 5: assert and boxing