bank.java
来自「java2参考大全上的例子的源码和自己的理解.」· Java 代码 · 共 31 行
JAVA
31 行
package exceptiondemo;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Bank { double balance; public void deposite(double dAmount) { if (dAmount > 0.0) { balance += dAmount; } } public void withdrawal(double dAmount) throws InsufficientFundsException { if (balance < dAmount) { throw new InsufficientFundsException(this, dAmount); } balance = balance - dAmount; } public void show_balance() { System.out.println("The balance is " + (int) balance); } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?