Skip to content

Instantly share code, notes, and snippets.

@anoited007
Created January 21, 2019 20:07
Show Gist options
  • Save anoited007/0616c159796786605d10d7f341a23d8c to your computer and use it in GitHub Desktop.
Save anoited007/0616c159796786605d10d7f341a23d8c to your computer and use it in GitHub Desktop.
public interface Bagable<T> {
//Open the bag
void open();
//Add item to the bag
void add(T t);
//Remove item from the bag
T remove(T t);
//Empty the bag
T[] empty();
//Check if bag is empty
boolean isEmpty();
//Check if bag is full (since we will use Arrays to store data)
boolean isFull();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment