您的位置:首页 > 编程语言 > Java开发

Java exception concepts

2011-12-22 14:20 260 查看
Java has created a number of jargon.  Here are some exception related slang:

1. Higher context.  To understand this jargon, imagine function callings like digging holes, the function call that is inside another function call is buried deeply.  So for a given function context, the higher context is any function context that is upper
than the given one.

2. Exception specification.  This is the Java syntax to notify client programmer which exception will be thrown from that function.  It appears after that arguments list of the definition of the function.

3. RuntimeException.  This base class is used by Java to handle errors that cannot be found by compiler, such as null reference, array index out of bounds, et al.  Java functions don't need to throw this kind of exceptions nor catch them.  Except this kind
of exception, all functions that may throw a exception must choose to 1), handle it; 2), write exception specification.  In the latter case, the client programmer should do the same thing.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐