Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int id;
- private double balance;
- private static double interestRate = DEFAULT_INTEREST_RATE;
- private static int bankAccount = 1;
- ArrayList idUsers = new ArrayList();
- BankAccount(){
- this.id = bankAccount++;
- }
- static void setInterestRate(double interestRate)
- {
- BankAccount.interestRate = interestRate;
- }
- void deposit(double amount)
- {
- this.balance += amount;
- }
- double getInterest (int years)
- {
- return BankAccount.interestRate * years * this.balance;
- }
- void setIdUsers()
- {
- this.idUsers.add("Id"+ id);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement