account.java
来自「bankconsole」· Java 代码 · 共 28 行
JAVA
28 行
package bankconsole;
public class Account {
protected int totalMoney;
public Account(int money) {
this.totalMoney = money;
}
public int deposit(int in) {
System.out.println("提示:存钱操作成功.");
return this.totalMoney = totalMoney + in;
}
public int withdraw(int out) {
if (out > totalMoney) {
return -1;
}
return this.totalMoney = totalMoney - out;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?