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

Is @Stable a generalization of the final keyword or is there more to it that I'm missing?


Final is an access modifier. It controls who can change a value (in this case, no one). And like other access modifiers, you can use reflection to remove or change those modifier. It is a security barrier the developer asks the system to uphold.

The Stable annotation is an optimization mechanism: a promise the developer makes to the compiler. It is on the developer to uphold.




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

Search: