Final in Java means the value of a variable, property or parameter will not change after its initial assignment. Values in Java can be either a reference to an object or a primitive such as an integer, double or bool. It's definitely far from useless as it asserts that the reference or value you capture in a closure is not an old version that has been replaced, this approach is a consequence of Java disallowing arbitrary pointers. IMO Java's biggest mistake here is mutability by default, which Kotlin has learned from. If you understand why it is this way it makes a lot of sense and tbh I think it promotes better code. That said I would like to see more immutability in Java and with things like Record classes you can see Java is moving in the right direction.
HN user
eganjs
10 karma
Posts0
Comments2
No posts found.
Safety: A comparaison between Rust, C++ and Go 4 years ago
Ask HN: Who wants to be hired? (May 2022) 4 years ago
Location: UK
Remote: Yes
Willing to relocate: No
Technologies: Kotlin, Scala, Java, Python, Linux, Kafka, AWS, GCP
Résumé/CV: https://drive.google.com/file/d/1tky_VwpRFLYcEhWupNi3XK_ipqg...
Email: cv@egan.dev
I am a Software Engineer who currently works in data. I have spent more than half of my career in technical leadership and this is a direction that I want to continue to grow and develop myself into. I am open to learning and working with technologies that are new to me as ultimately I consider myself a polyglot.