title: Strange Java Coding Style - Why?
body: <p>I've just came across some code which is slightly strange, I was wondering if anyone could shed light on why it might be written like this.</p>
  
  <p>I <em>think</em> it's got something to do with concurrency - so that the variables can't get changed if another thread accesses it (because variable updates aren't atomic). <em>Or</em> it's speed (because local variables are faster than class level variables?) <em>OR</em> I'm wrong on everything I've written here :)</p>
  
  <p>Oh, I'm not talking about the Hungarian notation, I'm talking about the local assignments inside the methods.</p>
  
  <pre><code>public Class Space
  {
    private double m_dWidth = 0;
  
    // Constructors &amp; other methods omitted for readability
    //...
  
    public double getWidth()
    {
       double dWidth = m_dWidth;
       return dWidth;
    }
  }
  </code></pre>