markdown java,try,catch,syntax

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown java,try,catch,syntax相关的知识,希望对你有一定的参考价值。

## Try...Catch... progress declear
when using try/catch, if you has not return, it mean you allow exception occur and let programe go on

```java
public class TestTryCatch {
    public static void main(String[] args) {
        int a = 0;
        try{
            int ret = 1/a;
        }catch(Exception e){
            System.out.println("div 0 error");;
        }

        System.out.println("process done");
    }
}
/* console output: 
* div 0 error
* process done
* Process finished with exit code 0
*/
```
you can see, even exception occur, it goes on.

以上是关于markdown java,try,catch,syntax的主要内容,如果未能解决你的问题,请参考以下文章

Java基础 throw 抛出异常后,用try...catch捕获

Java基础 try...catch...catch 使用众多异常的父类 Exception,去捕 获 其所有子类异常

Java基础 try...catch(多个异常) 多个异常采取同样的解决措施

markdown 思考:练习:函数,字符串,数字,if / else,try / catch / finally,typeof,undefined,NaN

Java try-catch自定义捕捉异常

在java语言中try-catch的catch中能否再加try--catch?