Which of the following can fill in the blank in this code to make it compile? (Select 2 options.)

- On line 1, fill in throws
- On line 1, fill in throws new
- On line 2, fill in throw new
- On line 2, fill in throws
- On line 2, fill in throws new
Answer(s): A,C
Explanation:
Option A and C are the correct answer.
In a method declaration, the keyword throws is used. So here at line 1 we have to use option A.
To actually throw an exception, the keyword throw is used and a new exception is created, so at line 2 we have to use throw and new keywords, which is option C. Finally it will look like;
public void method() throws Exception {
throw new Exception0;
}
Reference:
httpsy/docs.oracle.com/javase/tutorial/essential/io/fileOps.html#exception The correct answer is: On line 1, fill in throws. On line 2, fill in throw new
Reveal Solution Next Question