Output Array - Java Quiz Question


What will be the output of the following program?

public class ArrayOutput
{
    public static void main(String s[])
    {
        int student_marks[] = new int[5];
        student_marks[2] = 25;
        System.out.println("Third Element = " + student_marks[2]);
        System.out.println("Fourth Element = " + student_marks[3]);
        student_marks[5] = 50;
        System.out.println("Fifth Element = " + student_marks[5]);
    }
}


A
Third Element = 25
Fourth Element = 0
Fifth Element = null
B
Third Element = 25
Fourth Element = 0
Fifth Element = 50
C
Third Element = 25
Fourth Element = 0
Fifth Element = 0
D
Third Element = 25
Fourth Element = 0
Fifth Element = {EMPTY}
E
Compilation Error or Runtime Error