We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ceb03b commit 3d198c0Copy full SHA for 3d198c0
docs/java/Java程序设计题.md
@@ -73,7 +73,7 @@ public class MyStack {
73
74
//TODO:返回栈顶元素并出栈
75
private int pop() {
76
- if (count == -1)
+ if (count == 0)
77
throw new IllegalArgumentException("Stack is empty.");
78
count--;
79
return storage[count];
0 commit comments