Advertisement
Kur23

domashno1

Apr 13th, 2022
1,042
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. public class BankAccount {
  2.  
  3.     String bankName;
  4.     int accountID;
  5.     String user;
  6.     double money;
  7.  
  8.     public BankAccount() {
  9.  
  10.     }
  11.  
  12.     public BankAccount(String bankName, int accountID, String user, double money) {
  13.         this.bankName = bankName;
  14.         this.accountID = accountID;
  15.         this.user = user;
  16.         this.money = money;
  17.     }
  18.  
  19.     @Override
  20.     public String toString() {
  21.         return "BankAccount " + " Bank Name: " + bankName +
  22.                 ", Account ID: " + accountID + ", User: " + user + ", Money: " + money + '.';
  23.     }
  24.  
  25.     public void deposit(double deposit) {
  26.         this.money += deposit;
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement