r/java • • Aug 03 '25

Teach Me the Craziest, Most Useful Java Features — NOT the Basic Stuff

I want to know the WILD, INSANELY PRACTICAL, "how the hell did I not know this earlier?" kind of Java stuff that only real devs who've been through production hell know.

Like I didn't know about modules recently

393 Upvotes

279 comments sorted by

View all comments

Show parent comment

1

u/le_bravery Aug 04 '25

Kotlin does this well I think with type aliases.

3

u/PedanticProgarmer Aug 04 '25

Not realy. Type aliases don’t give you protection against mixing up Ids. You meant inline value classes.

2

u/illia225 Aug 04 '25

Yeah, but value classes in Kotlin aren't easily mapped in Spring Data, and we had deserialization issues with Jackson. Eventually, we switched to kotlin data classes.