MCQs>IT & Programming>Java>You have the following method, which throws an unchecked exception public boolean testArg(Integer n) throws IllegalArgumentException { if (n == null) throw new IllegalArgumentException(); /* ... */ } Is this throw specification correct?
Java MCQs
You have the following method, which throws an unchecked exception public boolean testArg(Integer n) throws IllegalArgumentException { if (n == null) throw new IllegalArgumentException(); /* ... */ } Is this throw specification correct?
Answer
Correct Answer: Yes. You need not specify an unchecked exception, but you are allowed to do so.
Explanation:
Note: This Question is unanswered, help us to find answer for this one