Java Programming
I need the answer asap, thank you!
Note: The attached photo is the unfinished version, please complete it. thank you so much!
Create an class 'Bank' with attributes name and balance. Create two constructor: default constructor and a constructor that accepts all attribute. Provide getters and setters for class 'Bank'. The class has an abstract method 'showDetails' with void as return type. Method 'showDetails' displays the name and balance of the account.
'BankA' and 'BankB' ' are subclasses of class 'Bank'. Create two constructor in each classes: default constructor; and constructor that accepts name and balance and call appropriate super constructor.
Code to be completed:public abstract class Bank { private String name; private int balance; public Bank(){}; public Bank(String name, int balance) { this.name = name; this.balance = balance; } // setters public void setName(String name) { this.name = name; } public void setBalance(int balance) { this.balance = balance; } //getters public String getName() { return name; } public int getBalance() { return balance; } public abstract void showDetails();}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here