Java 21: What’s New?
The matching syntax looks really good to me:<p><pre><code>    &#x2F;&#x2F; Java 21
    if (obj instanceof Point(int x, int y)) {
        System.out.println(x+y);
    }

    &#x2F;&#x2F; Older Java
    if (obj instanceof Point p) {
        int x = p.x();
        int y = p.y();
        System.out.println(x+y);
    }</code></pre>