Menu
Question Index
...

What will be the output of the following program?

class ArrayOutput
{
    public static void main(String s[])
    {
        int a[] = {12, 15, 16, 17, 19};
        int I = 0;
        
        for(; I < 5 ;)
        {
            System.out.println(a[I]);
            I++;
        }
    }
}


12
15
16
17
19
12
15
16
17
15
16
17
19
Compilation Error
Throws ArrayIndexOutOfBoundsException

Doubts

Problems

Topic: Learn Arrays And Loops

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App