File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes funda behind exception...handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "funda behind exception...handling" Watch "funda behind exception...handling" New topic
Author

funda behind exception...handling

jaspal singh
Ranch Hand

Joined: Sep 15, 2005
Posts: 54
hi guys,

wanted to know:

do exception only arise at runtime?

what are checked and unchecked exceptions?

what are Errors?


Teach me the art of forgetting, for I always remember wat I have forgotten.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Yes, Exceptions occur only at runtime.

Exceptions and Errors are both derived from Throwable (in java.lang).

"Checked" exceptions are those for which the compiler enforces either declaration or handling. All subclasses of Exception -- other than RuntimeExceptions and its subclasses -- are checked. (See bold below.)

RuntimeExceptions (e.g., bugs resulting in a NullPointerException) and Errors, or subclasses of these, are not checked and do not need to be declared or handled.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

For detailed information, see the "Error Handling with Exceptions" chapter in Bruce Eckel's Thinking in Java...

http://www.faqs.org/docs/think_java/TIJ311.htm
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
I am curious from the heading of your posting to know what a funda is?


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
do exception only arise at runtime?


In java tiger ( 5.0 ) can throw in compile time.




what are Errors?


Errors is uncheck exception.

An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions. The ThreadDeath error, though a "normal" condition, is also a subclass of Error because most applications should not try to catch it.

A method is not required to declare in its throws clause any subclasses of Error that might be thrown during the execution of the method but not caught, since these errors are abnormal conditions that should never occur.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Stuart Ash
Ranch Hand

Joined: Oct 07, 2005
Posts: 637
Hi Marcus,

"funda" is a relatively new word in English. It means "the underlying idea", the "fundamental reason/principle".

Stuart.



Originally posted by Marcus Green:
I am curious from the heading of your posting to know what a funda is?


ASCII silly question, Get a silly ANSI.
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

"funda" is a relatively new word in English.

Other relatively new English words include "ur", "bcos", and "sth".

Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
In java tiger ( 5.0 ) can throw in compile time.
Thats really good. Can you be more clear.
For example , will the compile check for exceptions like OutOfBounds Exception , etc at compile time ?


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
I think Steve is correct, it is not a word but a casual contraction. If you intention is to commmunicate, or to pursuade others to communicate with you I stongly urge you use complete words. Note that many, many people using these forums do not have English as a first language or even your particular version of English so for your own benefit in getting results, use a standardized English in technical communications.

When chatting with people U kno, U Can Uze eny variationz you like and you will be thort of as L33t d00d.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: funda behind exception...handling