This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
 
Similar Threads
Assertions
Assertions
Confusion in Assertion
Assertion
AssertionError