Skip to content

Instantly share code, notes, and snippets.

@Bjacksonshorts
Last active August 29, 2015 13:56
Show Gist options
  • Save Bjacksonshorts/9091076 to your computer and use it in GitHub Desktop.
Save Bjacksonshorts/9091076 to your computer and use it in GitHub Desktop.
public class Mom implements Replenishable{
private int bankAccount;
public int getCurrentAmount(bankAccount){
// finds out the current anoint in the bank account
}
public int getFullAmount(bankAccount){
// finds out how much there should be
}
public boolean isEmpty(){
// returns true if the current amount is 0
// returns false if not
}
public int replenish(){
// if the current amount eqauls the full amount then it will do nothing
// if the current amiunt does not equal the full amount then it will add half of the full amount to the current amount;
}
}
public class Mom implements Replenishable{
private int bankAccount;
public int getCurrentAmount(bankAccount){
// finds out the current anoint in the bank account
}
public int getFullAmount(bankAccount){
// finds out how much there should be
}
public boolean isEmpty(){
// returns true if the current amount is 0
// returns false if not
}
public int replenish(){
// if the current amount eqauls the full amount then it will do nothing
// if the current amiunt does not equal the full amount then it will make them equal
}
}
interface replenishable{
int getAmount(int x); // returns how much of the item there is
int getFullAmount(int x); // returns how much of the item there should be
boolean isEmpty(); // returns whether or not thre is any more of the item
int replenish(); // adds to the amount
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment