fork download
  1. public abstract class BankBase {
  2. private int money;
  3. private int accountNum;
  4. private int startYear;
  5. private static int currentYear;
  6. public BankBase(int accountNum) {
  7. this.accountNum = accountNum;
  8. currentYear = startYear;
  9. }
  10. public BankBase(int money, int accountNum) {
  11. this.money = money;
  12. this.accountNum = accountNum;
  13. currentYear = startYear;
  14. }
  15. public void depositMoney(int deposit) {
  16. this.money += deposit;
  17. }
  18. public void paimentMoney(int payment) {
  19. if(this.money < payment) {
  20. System.err.println("預金額より多い出金をしようとしています.");
  21. return;
  22. }
  23. this.money -= payment;
  24. }
  25. public int getMoney() { return money; }
  26. public int getAccountNum() { return accountNum; }
  27. public int getStartYear() { return startYear; }
  28. public void setStartYear(int startYear) { this.startYear = startYear; }
  29. public static void setCurrentYear(int Year) { currentYear = Year; }
  30. public static int getCurrentYear() { return currentYear; }
  31. public abstract void addInterest();
  32. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty