62,614
社区成员
发帖
与我相关
我的任务
分享
public class Finally {
public static void main(String[] args) {
int i=0;
String greetings[]={"Hello word!","Hello word!!","Hello word!!!"};
while(i<4) {
try {
System.out.println(greetings[i]);
}catch(ArrayIndexOutOfBoundsException e){
System.out.println("数组下标越界");
}finally{
System.out.println("--------");
i++;
}
}
}
}