异常-问题型

package com.yc;

import java.util.Scanner;

import java.util.Random;
public class Test2 {

/**
* @param args
*/
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int r=show();
System.out.println(r);

}

public static int show(){
int i=0;
try{
return i;
}catch(Exception w){//Exception 是所有异常的父类, 迟绑定
return 2;
}finally {
i=i+1;
}
}

}

The answer is 0  !!!

原文地址:https://www.cnblogs.com/yaobolove/p/4358472.html