Home » JAVA Programming » Exceptions » Question
  1. Which of these exceptions will be thrown if we declare an array with negative size?
    1. NegativeArrayException
    2. IllegalArrayException
    3. NegativeArraySizeExeption
    4. IllegalArraySizeExeption
    5. None of these
Correct Option: C

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.



Your comments will be displayed only after manual approval.