本帖最后由 xiayoutianxia 于 2014-10-12 15:53 编辑
public static void main(String[] args){
System.out.print(getString()); 结果是D2.5C 没懂 怎么是finaly先运行
}
private static String getString() {
String string = "2.5";
try {
int a = new Integer(string);
string += a * 2;
string += "E";
return string;
} catch (Exception e) {
string += "C";
return string;
} finally {
System.out.print("D");
}
}
|
|