error(编译阶段无法通过)
异常(编译阶段可以通过)
package com.caishui.model;
public class Error {
public static void main(String[] args) {
String [] s=new String[4];
s[0]="1";
s[1]="1";
s[2]="1";
s[3]="1";
s[4]="1";
try {
} catch (Exception e) {
System.out.println("排队中,请稍后......");
}
}
}
package com.caishui.model;
public class Error {
public static void main(String[] args) {
try {
String [] s=new String[4];
s[0]="1";
s[1]="1";
s[2]="1";
s[3]="1";
s[4]="1";
} catch (Exception e) {
System.out.println("排队中,请稍后......");
}
}
}