0 votes
in Education by (1.7m points)
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) new

The question was asked during an online interview.

This intriguing question originated from Exception Handling in section Exception Handling of Java

Select the correct answer from above options

JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by (1.7m points)
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.

Related questions