请指出下面程序的运行结果() 1.5分 public class TryDemo { public static void main(String[] args) { System.out.println(test()); } public static int test() { try { return 1; } catch (Exception e) { return 2; } finally { System.out.print(“3”); } } }

区块链毕设网qklbishe.com为您提供问题的解答

请指出下面程序的运行结果() 1.5分 public class TryDemo {
public static void main(String[] args) { System.out.println(test());
}
public static int test() { try {
return 1;
} catch (Exception e) {
return 2; } finally {
System.out.print(“3”); }
} }
finally为方法内部必执行的部分 , 先输出3 , 再return 1 , 输出 1 , 故为31
23:19

以上就是关于问题请指出下面程序的运行结果() 1.5分 public class TryDemo { public static void main(String[] args) { System.out.println(test()); } public static int test() { try { return 1; } catch (Exception e) { return 2; } finally { System.out.print(“3”); } } }的答案

欢迎关注区块链毕设网-
专业区块链毕业设计成品源码,定制。

区块链NFT链游项目方科学家脚本开发培训

承接区块链项目定制开发

微信:btc9767

QQ :1330797917

TELEGRAM: BTCOK9

承接区块链项目定制开发


qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台-javagopython毕设 » 请指出下面程序的运行结果() 1.5分 public class TryDemo { public static void main(String[] args) { System.out.println(test()); } public static int test() { try { return 1; } catch (Exception e) { return 2; } finally { System.out.print(“3”); } } }