Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BankProgram{
- private String name;
- private double balance;
- private int id;
- private static int amountOfIds = 0;
- public BankProgram(String name, double balance){
- amountOfIds ++;
- this.name = name;
- this.balance = balance;
- this.id = amountOfIds;
- }
- public double deposit(double amount){
- balance += amount;
- return balance;
- }
- public double withdrawl(double amount) {
- balance -= amount;
- return balance;
- }
- public double getBalance(){
- return balance;
- }
- public int getID(){
- return id;
- }
- public String getName(){
- return name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement