This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • 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