title: Is it bad practice to initialize a variable to a dummy value?
body: <p>This question is a result of the answers to <a href="https://stackoverflow.com/questions/2773779/problems-initializing-a-final-variable-in-java/2773811#2773811">this question</a> that I just asked.</p>
  
  <p>It was claimed that this code is "ugly" because it initializes a variable to a value that will never be read:</p>
  
  <pre><code>String tempName = null;
  try{
      tempName = buildFileName();
  }
  catch(Exception e){
      ...
      System.exit(1);
  }
  FILE_NAME = tempName;
  </code></pre>
  
  <p>Is this indeed bad practice? Should one avoid initializing variables to dummy values that will never actually be used?</p>
  
  <p>(EDIT - 
  And what about initializing a String variable to <code>""</code> before a loop that will concatenate values to the String...? Or is this in a separate category?</p>
  
  <p>e.g. </p>
  
  <pre><code>String whatever = "";
  for(String str : someCollection){
     whatever += str;
  }
  </code></pre>
  
  <p>)</p>