The lost modifier

Report a typo

You have a base class and a derived class. Both classes are in different packages.

The base class:

public class BaseClass {
    ??? int a;
}

The derived class:

public class DerivedClass extends BaseClass {
    private int b;

    public int sum() {
        return a + b;
    }
}

Which of the following access modifiers can be written instead of ??? to make this code compile?

Select one or more options from the list
___

Create a free account to access the full topic