Menu
Question Index
...

What exception does LINE A throw?

class ArrayExample
{
    public static void main(String s[])
    {
        int[] a = {0, 5, 6, 7};
        int total = a[1]/a[0] + a[2]/a[1] + a[3]/a[2] + a[4]/a[3]; // LINE A

        System.out.println("Total = " + total);
    }
}


ArithmeticException
ArrayIndexOutOfBoundsException
NullPointerException
No exception will be thrown

Doubts

Problems

Topic: Why Java Throws Exceptions

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App