Find the mistake

Report a typo

Read the code snippet below:

package com.mypackage;

public class A {
    protected A(){
        //protected constructor
    }
}
package com.anotherpackage;

import com.mypackage.A;

public class B {
    private A a = new A();
}

Why does this code produce a compilation error?

Select one option from the list
___

Create a free account to access the full topic