[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Sat Apr 10 23:50:48 2004 -->
- <!--x-from-r13: xwxehz ng pbzpnfg.arg (Yriva Yehzjvrqr) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: Pine.LNX.4.44.0404082203580.16364-[email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] OT: java filereader question -->
- <li><em>date</em>: Sat Apr 10 23:50:48 2004</li>
- <li><em>from</em>: kjkrum at comcast.net (Kevin Krumwiede)</li>
- <li><em>in-reply-to</em>: <<a href="msg00294.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00293.html">[email protected]</a>> <<a href="msg00294.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] OT: java filereader question</li>
> Where can I read something that explains decently what's going on with
>
> exceptions, do you know? It's certainly not a concept I'm familiar
> with, and everything I read just says "do this to catch an exception"
> which doesn't tell me _what_ I'm trying to do, or why, or what's
> actually going on when I do it.
Exceptions are a mechanism for enforcing error checking at compile time,
instead of having methods return error codes and just hoping you'll
check for them. When an exception is thrown, the method that threw it
returns immediately to its caller. If the caller doesn't handle it,
then it returns immediately to its caller, and so on. Normal execution
resumes at the first 'catch' block that handles the given type of
exception. If method A calls another method that might throw an
IOException, and method A doesn't handle it, then method A has to
declare that it might also throw an IOException.
Exceptions are objects just like any other, and they obey the same rules
of inheritance. All exceptions are derived, directly or indirectly,
from java.lang.Exception. If you want to define special error
conditions, you can create your own exception classes. A catch block
for a particular exception will also catch any subclasses.
Krum
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00293" href="msg00293.html">[ale] OT: java filereader question</a></strong>
<ul><li><em>From:</em> dchambers at bugfixer.net (Denny Chambers)</li></ul></li>
<li><strong><a name="00294" href="msg00294.html">[ale] OT: java filereader question</a></strong>
<ul><li><em>From:</em> jtaylor at onlinea.com (J.M. Taylor)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00327.html">[ale] Ping?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00329.html">[ale] [OT] Digital camera fix</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00295.html">[ale] OT: java filereader question</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00296.html">[ale] OT: Legit</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00328"><strong>Date</strong></a></li>
<li><a href="threads.html#00328"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>