Skip to content

Instantly share code, notes, and snippets.

@Chiamaka
Created September 24, 2015 17:10
Show Gist options
  • Save Chiamaka/4bb4e8598fe5b3930f52 to your computer and use it in GitHub Desktop.
Save Chiamaka/4bb4e8598fe5b3930f52 to your computer and use it in GitHub Desktop.
// 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