Menu
Question Index
...

What will be the output of the following program?

public class Tango
{
    public static void main(String[] args)
    {
        int[] print = new int[]{0, 1, 2, 3, 4, 5};
        System.out.print("\"Prints = ");
        System.out.print(print[0] + print[5] + print[2] + "\"");
    }
}


"Prints = 052"
"Prints = 7"
\"Prints = 7\"
Compilation Error
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