Stanislava
The first thing that you need to look at is class visibility. Then look at method visibility.
- AClass() object from a class located in different package
AClass has a default access modifier so AClass is not visible from outside of that package. So in this case the access modifier on the constructor method does not matter. This will not compile.
- BClass() object from a class (other than its subclass) located in different package
Once again BClass has default access modifier so the class is not visible. This will not compile.
- CClass() object from other class in the same package
This time the class is visible but the constructor is not so this will not compile.
- DClass() object from a class from different package ?
DClass is visible but the constructor is not so this will result in a compile error as well.
Is it always the more restricted of the two - class , constructor - that is taken into account?
You have to look at class visibility first, then the method visibility.
Hope this helps