Allowing javac to do this would be a mistake. Since there may be code in another bank that can rely on compiled code (modularity), changing the code at compile time for optimization is not an option.
As for the second argument, โnever need to be overloaded from main memoryโ, remember that most instance variables are cached. final only indicates immutability, this does not guarantee volatility (volatile == always gets the latest from main memory). Therefore, the need for locks and the volatile keyword in a multi-threaded environment.
As for the hot spot case, I have no idea, and would like to know more about it. final constants can be inserted at compile time, resulting in moderate performance. Link to a question about embedding in java
Edit:
Note that the
final one indicates immutability that needs to be taken with salt. It does not guarantee that the state cannot change, it only indicates that the reference to the object can be changed.
final indicates immutable primitive data types
questzen
source share