Skip to content
Snippets Groups Projects
Commit 8494df19 authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

Updated pop()

parent 2b84a776
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,9 @@ public class MyStack { ...@@ -16,7 +16,9 @@ public class MyStack {
} }
public Object pop() { public Object pop() {
return top.getPayload(); Object payload = top.getPayload();
top = top.getPrevious();
return payload;
} }
private class Node { private class Node {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment