• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Doubt in parseXXX( )

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I tried the following code and it compiles fine
Boolean b = Boolean.parseBoolean("true");
But In K&B, p-233, its given as parseXxx(without radix) is not for Boolean and Character.

So think there is a typo in the page

Thanks,
Sumi
 
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right, Sumi.

Boolean has a parseBoolean method, but Character doesn't have a parsing method.
And the error is not yet on the errata page.

Unlike the others, in Boolean it does not throw (self explaining!) a number format exception.
I'll send a note to the other moderators.


Yours,
Bu.
 
sumi selva
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

And also there is a booleanValue () method in java.lang.Boolean class.Think that shud also be corrected.


Thanks,
Sumi
 
Burkhard Hassel
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sumi selva:
Hi,

And also there is a booleanValue () method in java.lang.Boolean class.Think that shud also be corrected.



Yes, but this is already in the errata page. See this link:
https://coderanch.com/t/257589/java-programmer-SCJP/certification/SCJP-Errata-Updated

Bu.
 
Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic