exercise.java
来自「java编程代码」· Java 代码 · 共 28 行
JAVA
28 行
public class Exercise
{
public static void main(String[] args)
{
try
{
System.out.println("Trying");
sampleMethod(98.6);
System.out.println("Trying after call.");
}
catch(Exception e)
{
System.out.println("Catching.");
}
System.out.println("End program.");
}
public static void sampleMethod(double test)
throws Exception
{
System.out.println("Starting sampleMethod.");
if (test < 100)
throw new Exception( );
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?