1.

Which of these exceptions will be thrown if we declare an array with negative size?(a) IllegalArrayException(b) IllegalArraySizeExeption(c) NegativeArrayException(d) NegativeArraySizeExeption

Answer» Right choice is (d) NegativeArraySizeExeption

Easiest explanation: Array size must always be positive if we declare an array with negative size then built in exception “NegativeArraySizeException” is thrown by the java’s run time system.


Discussion

No Comment Found

Related InterviewSolutions