Created
February 19, 2019 22:24
-
-
Save gayapedro/b73a3341bc84ade4ee77d5becd3aa039 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| public class Stack{ | |
| private StackNode topOfStack; | |
| private class StackNode{ | |
| private Object element; | |
| private StackNode next; | |
| private StackNode(Object e, StackNode n){ | |
| element = e; | |
| next = n; | |
| } | |
| } | |
| public Stack(){ | |
| topOfStack = null; | |
| } | |
| public boolean isEmpty(){ | |
| return topOfStack==null; | |
| } | |
| public void makeEmpty(){ | |
| topOfStack=null; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment