1 2 3 4 5 6 7 8
// version 14: public class PatternInstanceOf { public void foo(Object o) { if (o instanceof String y) { System.out.println(y); } } }