Menu
Question Index
...

What will be the output of the following program?

class Jumbo
{
    static
    {
        i = 5;
    }
    static int i;

    public static void main(String[] args)
    {
        System.out.println("i value is " + i);
    }
}


i value is 0
i value is 5
i value is (some reference value)
Compilation Error

Doubts

Problems

Topic: Creating Static Methods In Java Using Static Keyword

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App