• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about toString() method

 
Shaan patil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

We all know that , string class is declared a final. Then how is it possible to override the toString method in the throwable class ?
 
Phani Burra
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Throwable class doesn't override the toString() method of the String class but it overrides the toString() method of the Object class.
 
Shaan patil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Phani Burra ,

You are right , The toString() method of the "Object" class is overridden in the Throwable class.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic