- public class A {
- /**
- * @param args
- */
- public static void main(String[] args) {
- try{
- throw new NullPointerException();//此行会抛出NullPointedException
- }
- catch(NullPointerException e){
- System.out.print("1");
- }
- catch(RuntimeException e){
- System.out.print("2");
- }
- finally{
- System.out.print("3");
- }
- }
- }
Java手动抛异常
最新推荐文章于 2024-04-27 14:15:35 发布