• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Boolean and Character class

 
Karthikeyan Balasubramanian
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii all....
there was a table in chapter 6 which shows the methods available in all the wrapper classes...
i had a doubt in it.
1.toString(primitive)------
2.valueOf(String)----------
is there such methods for Character and Boolean......y it was not specified in the book.
Thnaks in advance.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chapter 6 of what book?
 
Karthikeyan Balasubramanian
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.....i thought K&B book was defalut one.
it was in the K&B book.
 
Gyanesh Sharma
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume that you are talking about the book by K&B.

Boolean and Character both classes have valueOf() methods.
toString is available only for Boolean.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[GS]: toString is available only for Boolean.

No.

You know, the API can easily answer a question like this. Even without the API, you should know that every class inherits toString() from OBject or another superclass, if it doesn't have a toString() of its own.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[KB]: y it was not specified in the book.

Because the book does not necessarily list every method of every class, especially when they are standard methods inherited by all classes.
[ November 30, 2005: Message edited by: Jim Yingst ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic