当前位置:网站首页>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{
边栏推荐
猜你喜欢

DOM编程

【Tensorboard】所有雷区都踩,一文解决你所有问题

关于EasyPoi导入Excel文件二级表头数据时@ExcelEntity实体类里的第一列数据为null的这档事

Byte/byte?别搞晕了!

When easypoi imports the secondary header data of an excel file, the data in the first column of the @excelentity entity class is null

Embedded development terminology concept summary

機器學習|nltk_Data下載錯誤|nltk的stopwords語料下載錯誤解决方法
![[detailed explanation] point multiplication and cross multiplication of neural network matrix (pytorch version)](/img/17/e964216d81555d0a1203ee51d4698e.png)
[detailed explanation] point multiplication and cross multiplication of neural network matrix (pytorch version)

5 interview questions, grasp the underlying principle of string!

np.arange与np.linspace细微区别(数据溢出问题)
随机推荐
Php+stripe payment API, the latest PHP version of stripe overseas payment tutorial
MySQL field attribute list sends a document for future reference
DOM programming
【node】理论+实践让你拿下session、cookie
Fanatical NFT, foam or tuyere?
copy_from_user和copy_to_user
Originality: dozens of lines of pure PHP code decrypt goto encrypted PHP single file [for learning only]
Monaco editor format JSON, SQL
为啥要使用梯度下降法
Embedded development terminology concept summary
PHP output color image with specified height and width for web page background image
让你轻松上手【uni-app】
Apprentissage automatique | nltk Erreur de téléchargement des données | solution d'erreur de téléchargement du corpus stopwords pour nltk
Byte/byte?别搞晕了!
PHP de duplication and arrange complete small functions in descending order of length
Threejs implementation of simple panoramic view demo
How did the Delphi labs, the master of economic models behind axie and Luna, come into being?
Navicat for MySQL连接MySQL数据库时各种错误解决
稀疏数组^创建^还原^存盘^取盘--全家桶
断言assert()