📄 testchapter6.java
字号:
public class TestChapter6
{
static public void main(String[ ] args) throws Exception
{
Account a = new Account("Jeremy", 100.00f, 1000.00f);
a.deposit(500.00f);
a.withdraw(200.00f);
a.changeLOC(1500.00f);
int size = -10;
ArrayedStack s;
try
{
s = new ArrayedStack(size);
} catch (NegativeStackSizeException e)
{
System.out.println("Caught the NegativeStackSizeException exception");
System.out.println("The class of the exception is " + e.getClass());
System.out.println("The message with the exception is: " + e.getMessage());
System.out.println("So far the stack trace is: ");
e.printStackTrace();
System.out.println("Attempt to carry on with the default size of 10.");
s = new ArrayedStack(10);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -