<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Primitives on Devops Monk</title><link>https://devops-monk.com/tags/primitives/</link><description>Recent content in Primitives on Devops Monk</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 10 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://devops-monk.com/tags/primitives/index.xml" rel="self" type="application/rss+xml"/><item><title>Primitive Types in Patterns (JEP 507): Pattern Match Every Type</title><link>https://devops-monk.com/tutorials/java25/primitive-patterns/</link><pubDate>Sun, 10 May 2026 00:00:00 +0000</pubDate><guid>https://devops-monk.com/tutorials/java25/primitive-patterns/</guid><description>Note: JEP 507 is a preview feature in Java 25 (3rd preview). Enable it with --enable-preview at compile and runtime. It is expected to finalize in Java 26 or 27.
The Asymmetry in Pattern Matching Java 21 gave us pattern matching for switch and instanceof. It is a great feature — but it had a glaring asymmetry: it only worked with reference types.
Object obj = 42; // Java 21: works fine if (obj instanceof Integer i) { System.</description></item></channel></rss>