📄 excepdemo3.java
字号:
//Example 3 of Chapter 4
import javax.swing.JOptionPane;
public class ExcepDemo3
{
public static void main(String[] args)
{
String string[] = {"Easter Sunday","Thanksgiving","Christmas"};
String output = "";
int k = 0, m = 0;
try{
for(int i=0;i<5;i++)
{
k = i + 1;
output += string[i];
output += "\n";
m = i + 1;
}
}
catch(Exception e)
{
output += e.toString();
}
finally
{
output += "\nround " + k + " started";
output += "\nIt is terminated at round " + m;
}
JOptionPane.showMessageDialog( null, output );
System.exit( 0 );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -