猜猜下面的代码运行之后会输出什么

class Test {
    public static void main(String[] args) {
        try {
            System.out.println(1);
            return;
        } catch (Exception e) {
            System.out.println(2);
        } finally {
            System.out.println(3);
        }
        System.out.println(4);
    }
}

答案是

1
3

猜对了吗?

标签: java

添加新评论