1.

Which of the following operators is used to generate instance of an exception which can be thrown using throw?(a) thrown(b) alloc(c) malloc(d) newThe question was asked during an online interview.This intriguing question originated from Exception Handling in section Exception Handling of Java

Answer» RIGHT CHOICE is (d) new

For explanation I would say: new OPERATOR is used to CREATE instance of an exception. Exceptions may have parameter as a String or have no parameter.


Discussion

No Comment Found

Related InterviewSolutions