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.
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.
相关文章推荐
- 出现 java.util.ConcurrentModificationException 时的解决办法
- java exception java异常汇总(3)
- Proxy.newProxyInstance处引起 java.lang.ClassCastException 问题的解决方法
- Android--网络通信之java.net.SocketException: Permission denied错误
- [Domino]“java.lang.ClassCastException:lotus.domino.cso.Item”异常解决办法
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- java.io.NotSerializableException错误解决方法
- Caused by: java.lang.IllegalArgumentException: java.lang.RuntimeException: Error parsing Mapper XML.
- java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not
- java.lang.IllegalArgumentException: Page directive: invalid value for import
- Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Boots
- java.lang.IllegalArgumentException: node to traverse cannot be null!
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind 解决办法
- hadoop2.2.0升级成hdfs ha后查询报java.net.UnknownHostException
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- 异常:java.lang.ClassNotFoundException: org.springframework.web.jsf.DelegatingVariableResolver
- java.lang.reflect.InvocationTargetException
- Exception in thread "main" java.lang.UnsatisfiedLinkError: org.apache.hadoop.io .nativeio.NativeIO$Windows.createDirectoryWithMode0(Ljava/lang/String;I)V
- 严重 catalina.stop java.net.connectexception connection refused connect