package cn.study.concurrency.ch10; public class Account { private String staffAccount; //账号 private String passWord; //密码 private int balance; //账户余额 public Account(int money) { this.balance = money; } public String getStaffAccount() { return staffAccount; } public void setStaffAccount(String staffAccount) { this.staffAccount = staffAccount; } public String getPassWord() { return passWord; } public void setPassWord(String passWord) { this.passWord = passWord; } public void debit(int amount) { System.out.println("转出账户:" + amount); } public void credit(int amount) { System.out.println("转入账户:" + amount); } public int getBalance() { return balance; } public void setBalance(int balance) { this.balance = balance; } }
Test results: