LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-20-2002, 04:18 PM   #1
mikeshn
Member
 
Registered: Feb 2002
Distribution: Fedora Core 2
Posts: 586

Rep: Reputation: 30
Runtime Exception vs. Exception


Hello

What is differnce between Runtime Exception and Exception?

Thanks
 
Old 09-22-2002, 05:33 AM   #2
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
I presume you mean in Java??

Well, Exception is a generic, abstract exception class, and RuntimeException is an abstract subclass of Exception (RuntimeException itself is never thrown, only one of its subclasses such as NegativeArraySizeException).

If you mean, why bother making a distinction between Exceptions and RuntimeExceptions when all of RuntimeException's subclasses could inherit directly from Exception, it's because it's useful to group exceptions so you can catch several at once instead of having to catch a big list of them.

Btw, I realise that Exception and RuntimeException are not technically abstract classes, as their methods have an implementation, but they are abstract in the sense that they do not describe specific exceptions.

I hope that's somrthing like the answer you wanted, but it was a very unclear question...

Alex
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I get an exception when trying to start Azureus dr_zayus69 Linux - Software 7 12-15-2007 12:30 AM
Exception Handling vipinsharma Programming 2 09-25-2005 11:05 AM
Exception Handling C++ Hady Programming 3 07-26-2005 11:07 PM
help createing exception class from base STL exception qwijibow Programming 4 04-20-2005 05:23 AM
CPU exception zaicheke Linux - Hardware 3 11-26-2004 11:37 AM


All times are GMT -5. The time now is 10:39 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration