1.下列程序的运行结果为: 。
public class Test {
public static void main(String args[ ]) {
try {
myMethod();
System.out.println("Exception ");
} catch (MyException me) {
System.out.println(me.getMessage());
System.out.println(me);
} finally {
System.out.println("Over");
}
}
public static void myMethod() throws MyException {
throw new MyException("Exception");
}
}
class MyException extends Exception {
public MyException(String message) {
super(message);
}
public String toString() {
return " Customized exception";
}
}
2.以下程序运行时输入1 2 3 a b c 1 2 3 -1后按回车键,则运行结果为: 。
public class Test {
public static void main(String args[ ]) {
Scanner scan = new Scanner(System.in);
int i = 0, sum = 0, errNum = 0, totalNum = 0;
while (i