SHARE
TWEET

Untitled

sunspeak Oct 21st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.ArrayList;
  2.  
  3. public class BankAccount
  4. {
  5.     private final static double DEFAULT_INTEREST_RATE = 0.02;
  6.     private int id;
  7.     private double balance;
  8.     private static double interestRate = DEFAULT_INTEREST_RATE;
  9.     private static int bankAccount = 1;
  10.     ArrayList idUsers = new ArrayList();
  11.     BankAccount()
  12.     {
  13.         this.id = bankAccount++;
  14.     }
  15.     static void setInterestRate(double interestRate)
  16.     {
  17.         BankAccount.interestRate = interestRate;
  18.     }
  19.     void deposit(double amount)
  20.     {
  21.         this.balance += amount;
  22.     }
  23.     double getInterest (int years)
  24.     {
  25.         return BankAccount.interestRate * years * this.balance;
  26.     }
  27.      public void setIdUsers()
  28.     {
  29.         this.idUsers.add("Id"+ id);
  30.         this.id = bankAccount ++;
  31.  
  32.     }
  33.  
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top