Which of these exceptions will be thrown if we declare an array with negative size?
A. IllegalArrayException
B. IllegalArraySizeExeption
C. NegativeArrayException
D. NegativeArraySizeExeption
Answer:A
Which of these exceptions will be thrown if we declare an array with negative size?
A. IllegalArrayException B. IllegalArraySizeExeption C. NegativeArrayException D. NegativeArraySizeExeption
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.