Java, Java8, Java21, Java17, Migration.
is now a part of standard delivery. // Traditional instanceof if (animal instanceof Cat) { Cat cat = (Cat) animal; cat.meow(); // other cat operations } // Modern instanceof if (animal instanceof Cat cat) { cat.meow(); } Records Java 14 introduces a new class type record as preview feature to