Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Stack extends ArrayList {
public void push(Object value) { … }
public Object pop() { … }
}
//Stack does not behave Like an ArrayList
//besides pop, push, top it also implements (or overrides) get, set, add, remove and clear
//stack elements can be arbitrary accessed
//both classes are concrete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment