aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes K&B bk,question regarding Boolean Wrapper Class 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 "K&B bk,question regarding Boolean Wrapper Class" Watch "K&B bk,question regarding Boolean Wrapper Class" New topic
Author

K&B bk,question regarding Boolean Wrapper Class

Vishy Karl
Ranch Hand

Joined: Sep 08, 2003
Posts: 116
Hi all,
In K&B bk on pg 378(Indian Edition)-2nd paragraph it is given that

" The constructors for the Boolean wrapper class take either a boolean value true or false, or a case-insensitive String with the value "true" or "false"........... "

Now my question is that in fact the constructor of Boolean class takes any string as argument and not just "true" or "false".
The only thing is that if the String is other than "true" then the newly created Boolean wrapper object will be initialized to false.
ie.
Boolean thisworks = new Boolean("abcde");
System.out.println(thisworks); //prints false
So should this not be corrected in the book ???
I hope Kathy and Bates take this into consideration too and correct the statement in the book.
Thanks,


"The man who can drive himself further once the effort gets painful is the man who will win." <br />Roger Bannister
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8829
    
    5
Hi Vishy -
I think we will clarify that statement in the book, thanks for the input.
I want to ask everybody again.... please email us if you have an idea for our book!
We sometimes miss threads on this forum, and we won't miss any emails you send us!
Bert
p.s. As an added benefit, if you email us, then you get your name listed in future printings of the book! (if you want :roll: )


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Johannes de Jong
tumbleweed
Bartender

Joined: Jan 27, 2001
Posts: 5089
Nice deep one Vishy. Heck were are the days when I tought things trough so well. I feel sooo old sometimes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: K&B bk,question regarding Boolean Wrapper Class