Menu
Question Index
...

What will be the output of the following program?

public class ArrayOutput
{
    public static void main(String s[])
    {
        int student_marks[] = new int[39];
        student_marks = new int[]{10, 20, 30};
        int[] my_array = null;
        my_array = student_marks;
        System.out.println("My Array length is: " + my_array.length);
        System.out.println("Student Marks Array length is: " + student_marks.length);
    }
}


My Array length is: 3
Student Marks Array length is: 39
My Array length is: 39
Student Marks Array length is: 39
My Array length is: 3
Student Marks Array length is: 3
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Array Initialization

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App