Skip to content

Commit f9be98b

Browse files
committed
Feat: updates stack.java file
1 parent 69419e8 commit f9be98b

File tree

1 file changed

+2
-1
lines changed
  • lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12

1 file changed

+2
-1
lines changed

lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12/Stack.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ public void push(int value) {
1515
}
1616

1717
public int pop() {
18+
int headnumber = top.val;
1819
top = top.next;
19-
return top.val;
20+
return headnumber;
2021
}
2122

2223
public int peek() {

0 commit comments

Comments
 (0)