GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java

 Print  |  
Question:  why should we extend Exception instead of Throwable?

Answer: We usually extend Exception instead of Throwable. Why? In what situations we extend Throwable.
Could anybody give the answer in detail. Thanks in advance.


May 05, 2008 16:08:58 #1
 rariedel Microsoft Expert  Member Since: May 2008    Total Comments: 8 

RE: why should we extend Exception instead of Throwable?
 
Extending the Exception class (a descendant of Throwable) instead of extending Throwable itself is a programming convention, not a requirement.

Like most conventions, following the convention lends consistency to the end result.
     

 

Back To Question