Last active
December 21, 2022 03:03
-
-
Save mcsee/3edd25966d27541140a3e4672f5e9b3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Collection { | |
public abstract int size(); | |
} | |
final class Stack extends 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