title: Does the Java 'final' keyword actually improve security?
body: <p>While there are <a href="http://renaud.waldura.com/doc/java/final-keyword.shtml" rel="noreferrer">many reasons to use the 'final' keyword in Java</a>, one of the ones I keep hearing over and over again is that it makes your code more secure. While this seems to make sense in this trivial case:</p>
  <pre><code>public class Password
  {
      public final String passwordHash;
      ...
  }
  </code></pre>
  <p>With the final keyword, you would expect that no malicious code would be able to change the variable passwordHash. However, <a href="http://www.javaspecialists.eu/archive/Issue096.html" rel="noreferrer">using reflection</a> it is possible to change the final modifier on the passwordHash field.</p>
  <p>So does 'final' provide any real security, or is it just placebo?</p>
  <p><strong>Edit:</strong>
  There is some really interesting discussion, and I wish I could accept more than one answer. Thanks everyone for your input.</p>