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
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 477 of 490    Print  
why should we extend Exception instead of Throwable?
We usually extend Exception instead of Throwable. Why? In what situations we extend Throwable.
Could anybody give the answer in detail. Thanks in advance.



  
Total Answers and Comments: 1 Last Update: May 27, 2008     Asked by: svk_viza 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: rariedel
 
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.

Above answer was rated as good by the following members:
interviewprep9
May 27, 2008 16:08:58   #1  
rariedel Member Since: May 2008   Contribution: 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.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

Latest Answer : 1.Checked Exceptions  Environmental error that cannot necessarily be detected by testing; e.g. disk full, broken socket, database unavailable, etc.   2.Runtime Exceptions  Programming errors that should be detected in testing: index out ...

We know that Object class is super class of every class & a class extends only one class. so how is it possible to a class to extend other than Object class?
Because java supports multilevel inheritance. 
Read Answers (2) | Asked by : tulasi

Latest Answer : Exception created by  our own  is called User define Exception ...
Read Answers (7) | Asked by : chandu

Latest Answer : Hey Guys,Object class implements a set of methods and variables which are common to all the objects being created in the application. This is the main reason why we have Object class as a base class for all the other classes.Some of the methods are:hashCode() ...
Read Answers (4) | Asked by : kalyan

In overriding, the super class method throws I/O exception & in sub class that method throws arithmetic exception. what happens?

Which is superclass of Exception?many people think that object,no there is particular class which is superclass of all exception it starts with letter B,plz tell me
Read Answers (6) | Asked by : manohar

1. Can You catch the Error? 2. Difference between compiletime exception and runtime exception?3. How you throw user defined exception?4. How you handle throwable while using exceptions ?5. What are the methods available in Object ?6. Is there any methods available in serialization ?7. How you seralize an Object ?8.How you get the serialized object ? 9. Any methods available in deseralization ?

I have code like this class parent { void print()throws IOException{} }class sub{ void print() throws Exception{}}It will not allow like this super class method should throw an exception of sub class Exception which is in sub class method?
Read Answers (5) | Asked by : naresh

What is checked and unchecked exception? How can we know that any exception is checked or unchecked?
Read Answers (6) | Asked by : diensh

Latest Answer : " Throwable " is a class(it's default super class is Object) in java API. The Throwable class is the superclass of all errors and exceptions in the Java language. Only objects that are instances of this class (or one of its subclasses) are thrown by ...
Read Answers (1) | Asked by : veera


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

JavaScript Exception Handling – Part II

JavaScript Exception Handling Part II In this JavaScript tutorial you will learn about exception handling viz try… catch finally statement and nested try… catch statements along with syntax and examples mosgoogle center try… catch finally Statement JavaScript has a
 

JavaScript Exception Handling – Part I

JavaScript Exception Handling Part I In this JavaScript tutorial you will learn about Exception Handling Catching errors in JavaScript Using try catch statement and throw in JavaScript along with syntax and examples mosgoogle center It is impossible for a programmer to write a program without erro
 

Using UML with Java

Using UML with Java While Java is not a new language its application for the development of embedded systems is quite new Developers are beginning to take a second look at modeling languages such as UML and many feel it can be a powerful tool in their development arsenal mosgoogle center Introductio
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

Java Technology Trends

Technology Trends Involving Java Java is an object oriented programming language OOP for Web browsers It is organized around data rather than actions and supports polymorphism which allows the same code to be written generically so it can function with different datatypes inheritance which allows on
 

How To Extend the Capabilities of ERP

How To Extend the Capabilities of ERP When the ERP boom begin in the 1990s it allowed a large number of companies to begin obtaining a clear view of their various operations and processes While it offered them a number of advantages there were still challenges that they needed to overcome The bigges
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape