Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavapattern matching switch instanceofSingle-choice MCQ

What does this method print when called with the integer value 0?

static String classify(Object o) { return switch (o) { case Integer i when i > 0 -> "positive"; case Integer i when i < 0 -> "negative"; case Integer i -> "zero"; default -> "other"; }; }