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