Getting fields of classes

Report a typo

Here is a class with two methods and one constructor:

class Clazz {
    int magic;

    public Clazz(int magic) {
        this.magic = magic;
    }

    public static int staticMethod(int a) { return a + a; }

    public int instanceMethod(int b) { return b * magic; }
}

There is also an instance of the class:

Clazz instance = new Clazz(10);

Select all correct method references.

You may need to experiment with the code locally to solve this problem.

Select one or more options from the list
___

Create a free account to access the full topic