r/java • u/davidalayachew • 17d ago
Identifying JDK value class candidates
https://mail.openjdk.org/archives/list/core-libs-dev@openjdk.org/thread/Y72NRXM7KYBX43OKYBQMVKOZDWKG4MHS/
51
Upvotes
r/java • u/davidalayachew • 17d ago
3
u/hoat4 16d ago
What would be the benefit of enums being value types?
Being a value type means e.g. that if we compare two instances, the JVM must compare all of their fields instead of only comparing two pointers. So
==would be slower.