Traditional switch statements require break; to avoid fall-through bugs. Since Java 14+, modern Switch Expressions use arrow syntax (->), never fall through, support multiple comma-separated labels, and can return a value directly!
ADVERTISEMENT