Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaFunctional interfacesSingle-choice MCQ

Given this code, what is printed?

interface I1 { default int f() { return 1; } }\ninterface I2 { default int f() { return 2; } }\nclass C implements I1, I2 { public int f() { return I2.super.f(); } }\nSystem.out.println(new C().f());