Select correct lines

Report a typo

You are given two classes: org.demo.A and org.demo.example.B.

package org.demo;

public class A {

    private int field1;

    protected int field2;
    
    public void methodA() { }
}

and

package org.demo.example;

import org.demo.A;

public class B {

    private void methodB() {
        A a = new A(); // (1)

        int f1 = a.field1; // (2)
        int f2 = a.field2; // (3)

        a.methodA(); // (4)
    }
}

Select all correct lines.

Select one or more options from the list
___

Create a free account to access the full topic