aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Assertions and Wrapperclass Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Assertions and Wrapperclass" Watch "Assertions and Wrapperclass" New topic
Author

Assertions and Wrapperclass

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

Hi Ranchers,
What is wrong here with assertions enabled at run time?

Boolean b = new Boolean("false");
assert b:"Assertions failed";

I have a question. If I run this code against 1.4, it produces compiler error. Is it because the autobox facility is not available in 1.4 and does this compile succesfully in 1.5? I dont have 1.5 version. So can anyone help me with this?

Regards,
Jothi Shankar Kumar. S


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Charith Fernando
Ranch Hand

Joined: Sep 12, 2005
Posts: 67
this compiles in JAva 5.. simply because of the reason you have speicified... autoboxing


Charith I Fernando<br />SCJP5, SCWCD, SCBCD, BSc(Hons) IS<br />+94 773 263 222 (mobile)
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

Hi Charith Fernanda,

Thanks for confirming.

Regards,
Jothi Shankar Kumar. S
 
Don't get me started about those stupid light bulbs.
 
subject: Assertions and Wrapperclass