mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-20 22:17:09 +08:00
Update Java程序设计题.md
This commit is contained in:
parent
2ceb03b1ab
commit
3d198c09b9
@ -73,7 +73,7 @@ public class MyStack {
|
||||
|
||||
//TODO:返回栈顶元素并出栈
|
||||
private int pop() {
|
||||
if (count == -1)
|
||||
if (count == 0)
|
||||
throw new IllegalArgumentException("Stack is empty.");
|
||||
count--;
|
||||
return storage[count];
|
||||
|
Loading…
x
Reference in New Issue
Block a user