问题描述: 写测试类的主方法时,报错Unhandled exception type OverdraftException 解决方案: Eclipse提供了两种方案: 在main方法声明throws异常;在可能发生异常的地方try catch。 第一种方法: 第二种方法: 总结: 新建的测试类写main方法需要重新throws异常或者try catch,即要么抛要么catch。 若是在已经声明throws 或try catch的类写main方法时,可以不用再次声明。