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

What does this record-deconstruction pattern with instanceof print?

record Point(int x, int y) {} Object o = new Point(3, 4); if (o instanceof Point(int x, int y) && x < y) { System.out.println(x + y); } else { System.out.println("no"); }