Greeting guys, who can help me to solve this test? I have 2 options for solving.


The following class structure
abstract class I {
abstract void x{); static I factory() {
return new C1() ;
}
}
class Cl extends T {
@Override public void x() {
System.out.println("cl")f
} " '
}
class C2 extends I {
@Override public void x() {
System.out.println("c2") ; }
}
And the following statement:
I.factory().x();
Will output c1 because:
a) Java compiler replaces l.factory().x(); with Cl.factory().x();
b) java runtime environment calls the x(] of the instance type and not of the reference type;