The value of a static field

Report a typo

There is a class named SomeClass:

class SomeClass {

    private static int field = 1;

    static  {
        field = Integer.MAX_VALUE;
    }

    public SomeClass(int val) {
        field = val;
    }
}

What is the value of the static field after executing the following code? Enter an integer number.

SomeClass instance1 = new SomeClass(100);
SomeClass instance2 = new SomeClass(200);
Enter a number
___

Create a free account to access the full topic