Created
September 24, 2015 17:10
-
-
Save Chiamaka/4bb4e8598fe5b3930f52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// abstract class BankAccount that cannot be instiatied but can be inherit by subclasses | |
public abstract class BankAccount{ | |
private int accountNumber; | |
private String accountName; | |
private int balance; | |
public void deposit(); | |
public void withdraw(); | |
} | |
public class SavingAccount inherits BankAccount{ | |
//this subclass savings account has inherited all the properties and methods of the abstract class | |
//additional and more specific method | |
public void interestRate(){ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment