• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class toString

 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When does toString gets fired even if for Class like Integer, Bigdecial
For an eg: System.out.println("Value is" +varInt);
Does all class can be converted to toString
Regards,
aakash
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a toString method in the super class Object. You can override the method to output meaning info pertaining to the object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic