This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The fact that a final variable can be initialized within it's constructor gives you the possibility of taking in a parameter at the command line and using that to set the final variable. Be aware though that if you defer initializing a final variable, then it has to be initialized in EVERY ONE of the classes constructors, and some classes have many overloaded constructors. In addition if you have a static final variable, it can be set in a static initializer block. Lastly, if you have a local final variable (like inside a method) it can defer it's initializaion, allowing the value to be passed to the method at runtime. But aside from these "construction" exceptions, Eric is correct, once initialized it can never be modified.
"JavaRanch, where the deer and the Certified play" - David O'Meara
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Can a final variable be changed at runtime