Package modernfeatures.java21
package modernfeatures.java21
-
ClassesClassDescriptionDemonstrates both the classic instanceof/cast approach and the modern pattern matching for switch (Java 21+) using a classic class hierarchy.Demonstrates Java 21+ pattern matching for switch with enums.Demonstrates Java 21+ pattern matching for switch with nested record patterns.Demonstrates SequencedCollection in Java 21 using an ArrayList.Demonstrates SequencedMap in Java 21 using a LinkedHashMap.Demonstrates SequencedSet in Java 21 using LinkedHashSet.Demonstrates and compares classic (platform) threads and virtual threads in Java 21+.Demonstrates joining and checking the status of both classic (platform) threads and virtual threads in Java 21+.Demonstration of Virtual Threads in Java 21+.