Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active Nov 18, 2021
Embed
What would you like to do?
abstract class Collection {
public abstract int size();
}
final class Stack extendes Collection {
private contents[] ArrayList;
public Stack() {
contents = new long[maxSize];
}
public void push(Object value) { … }
public Object pop() { … }
public int size() {
return contents.size();
}
}
final class ArrayList extends Collection {
public int size() {
//...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment