📄 arrayindexoutofboundsexceptionexample.java
字号:
class ArrayIndexOutOfBoundsExceptionExample{
public static void main(String[] args) {
int[] myInt={1,2,3,4,5,6,7,8,9,10};
try{
for(int i=0;;i++)
System.out.println(myInt[i]);
}catch(ArrayIndexOutOfBoundsException e){
System.err.println("数组下标越界");
System.err.println(e.toString());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -