Mystery of the methods

Report a typo

You are given a class containing static and instance field and methods:

class MyClass {

    static int field = 10;

    public MyClass() {
        method2(); // (1)
    }

    void method1() { 
        method2(); // (2)
    } 

    static void method2() { 
        this.method3(); // (3)
    }

    void method3() { 
        System.out.println(field); // (4)
    }
}

Select all commented lines of code that won't raise a compilation error.

Select one or more options from the list
___

Create a free account to access the full topic