当前位置:网站首页>Try/finally --return those things
Try/finally --return those things
2022-06-22 09:13:00 【C_ x_ three hundred and thirty】
public class CCC {
public static void main(String[] args) {
int k = f_test();
System.out.println(k);
}
public static int f_test(){
int a = 0;
try{
a = 1;
return a;
}
finally{
System.out.println("It is in final chunk.");
a = 2;
// return a;
}
}
}result :
It is in final chunk.1
Conclusion : If try There are return be finally Inner statement precedes return perform
public class CCC {
public static void main(String[] args) {
int k = f_test();
System.out.println(k);
}
public static int f_test(){
int a = 0;
try{
a = 1;
return a;
}
finally{
边栏推荐
- PIP3 install XXX reports an error: command'lsb_ release -a' returned non-zero exit status 1.
- Jinglianwen Technology: product summary of machine learning AI dataset (III)
- 【uni-app】实战总结(含多端打包)
- Alibaba big fish SMS interface PHP version, simplified version Alibaba big fish SMS sending interface PHP instance
- There are three ways to traverse the map. Second, you know
- PHP login registration page
- 两个线程各执行100次i++,得到的可能值
- ==经典面试题
- Monaco editor format JSON, SQL
- VMware installation Kali
猜你喜欢

機器學習|nltk_Data下載錯誤|nltk的stopwords語料下載錯誤解决方法

Didi's two-sided summary

Machine learning | nltk_ Data download error |nltk's stopwords corpus download error solution

User insight into the video industry in January 2022: active users began to pick up under the influence of holidays

MySQL中常用的SQL语句

Solidity from introduction to practice (III)

PHP login registration page

Troubleshooting various errors when Navicat for MySQL connects to MySQL database

kali木马入侵win7系统

Performance optimization topics
随机推荐
list_ head
Navicat for MySQL连接MySQL数据库时各种错误解决
Solidity from introduction to practice (III)
MySQL field attribute list sends a document for future reference
PIP3 install XXX reports an error: command'lsb_ release -a' returned non-zero exit status 1.
Two threads execute i++ 100 times respectively, and the possible values obtained
simple_ Strtoull character conversion related functions
版本问题导致“无法定位程序输入点OPENSSL_sk_new_reserve于动态链接库C:\Users...\libssl-1_1-x64.dll”
两个线程各执行100次i++,得到的可能值
Fanatical NFT, foam or tuyere?
Shell中的单中括号和双中括号的区别
断言assert()
[network security officer] an attack technology that needs to be understood - high hidden and high persistent threats
Solidity from introduction to practice (V)
Sound and shadow 2022 heavy release! Detailed explanation of the new functions of Huisheng Huiying 2022
Byte/byte?别搞晕了!
PHP login registration page
np. Arange and np Linspace nuances (data overflow problem)
800+ PHP grammar and words are proficient only after you have used them
循环队列超详细实现,小白秒懂