一道关于exception的题目。
import java.io.*;
class Excep{
static void method() throws Exception{
throw new EOFException();
}
public static void main(String args[]){
try{
method();
}catch(////){}
}
}
Which of the following should be placed at //// so that the code will
compile without errors?
1. IOException e
2. EOFException e
3. MalformedURLException e
4. NullPointerException e
5. Exception e
6. FileNotFoundException
这道题目的答案是 1、2、5对吗