Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Currently Java supports records (finalized in JDK 16) and sealed classes (JDK 17) which together work as algebraic data types; pattern matching in switch was finalized in JDK 21. The syntax is pretty sweet

https://blog.scottlogic.com/2025/01/20/algebraic-data-types-...



oh thats cool. thanks for sharing!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: