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];
        float[] my_array = new float[student_marks.length];
        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: 39
Student Marks Array length is: 0
My Array length is: 39
Student Marks Array length is: 39
Compilation Error
Runtime Error

Doubts

Problems

Topic: Creation And Declaration Of Array In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App