|
0
|
| Scruffy Nerfherder · 技术社区 · 10 年前 |
|
|
1
2
HandleArrayIndexOutOfBoundsException是个坏主意,您需要检查当前
|
|
|
2
1
我将这样声明push方法,以表明如果达到最大值,它将抛出异常:
然后在main方法中,可以使用try/catch块来处理异常:
|
|
|
3
0
围绕任何将抛出IndexOutOfBounds的try-catch循环
|