Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavamain entry pointSingle-choice MCQ

What does this code print?

class A { static String f() { return "A"; } }\nclass B extends A { static String f() { return "B"; } }\nA a = new B();\nSystem.out.println(a.f());