<story><title>Java 21: What’s New?</title><url>https://www.loicmathieu.fr/wordpress/en/informatique/java-21-quoi-de-neuf/</url></story><parent_chain></parent_chain><comment><author>jph</author><text>The matching syntax looks really good to me:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    &amp;#x2F;&amp;#x2F; Java 21
    if (obj instanceof Point(int x, int y)) {
        System.out.println(x+y);
    }

    &amp;#x2F;&amp;#x2F; Older Java
    if (obj instanceof Point p) {
        int x = p.x();
        int y = p.y();
        System.out.println(x+y);
    }&lt;/code&gt;&lt;/pre&gt;</text></comment>
<story><title>Java 21: What’s New?</title><url>https://www.loicmathieu.fr/wordpress/en/informatique/java-21-quoi-de-neuf/</url></story><parent_chain></parent_chain><comment><author>theandrewbailey</author><text>&amp;gt; Java collections don’t have a type representing an ordered sequence of elements, Java 21 fills this gap by introducing the SequencedCollection, SequencedSet and SequencedMap interfaces. These interfaces provide methods for adding, modifying or deleting elements at the beginning or end of the collection, as well as for iterating over a collection in reverse order.&lt;p&gt;That sounds like a deque, and it&amp;#x27;s been in Java for a long time. (No set or map implementations though.)&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.oracle.com&amp;#x2F;en&amp;#x2F;java&amp;#x2F;javase&amp;#x2F;18&amp;#x2F;docs&amp;#x2F;api&amp;#x2F;java.base&amp;#x2F;java&amp;#x2F;util&amp;#x2F;Deque.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https:&amp;#x2F;&amp;#x2F;docs.oracle.com&amp;#x2F;en&amp;#x2F;java&amp;#x2F;javase&amp;#x2F;18&amp;#x2F;docs&amp;#x2F;api&amp;#x2F;java.base...&lt;/a&gt;</text></comment>