• Post Reply Bookmark Topic Watch Topic
  • New Topic

valueOf() method  RSS feed

 
Mahesh Barik
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for which object we can not use valueOf() method?
I have doubt please help
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can call valueOf() on an object of any class that defines a method valueOf(). You can't call it on any other object. Read the API to see what classes define valueOf().
 
ramesh kumar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we can use this method in wrapper to create object for primitive type
 
Mahesh Barik
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was asked in an interview for which object we cannot use valueOf() method?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!