posted 15 years ago
There is a difference between a class being final and a variable being final.
Final for a class means that it can't be subclassed. Nothing more, nothing less.
Final for a variable (local, instance field, static field) means that it can only can have its value set once - and never again. A final parameter is similar - it can only be assigned from the method call.
In your example, you first assign "Test" to the final variable name. That means that name can never get a new value, and that's just what you're trying to do afterwards.