ExceptionCallbackMain.java
资源名称:Source.rar [点击查看]
上传用户:songled
上传日期:2022-07-14
资源大小:94k
文件大小:1k
源码类别:
进程与线程
开发平台:
Java
- public class ExceptionCallbackMain
- extends Object
- implements ExceptionListener {
- private int exceptionCount;
- public ExceptionCallbackMain() {
- exceptionCount = 0;
- }
- public void exceptionOccurred(Exception x, Object source) {
- exceptionCount++;
- System.err.println("EXCEPTION #" + exceptionCount +
- ", source=" + source);
- x.printStackTrace();
- }
- public static void main(String[] args) {
- ExceptionListener xListener = new ExceptionCallbackMain();
- ExceptionCallback ec = new ExceptionCallback(xListener);
- }
- }