zl程序教程

您现在的位置是:首页 >  后端

当前栏目

java 的 try catch

JAVA try catch
2023-09-27 14:25:19 时间

try {
  写要执行的代码;
  return "操作成功";
} catch (Exception e) {


  e.printStackTrace();     # 这个是把具体的错误打印出来

  return "操作失败" 

}
}

 

 

catch里面也可以跳过啥都不做 

continue;