title: Issues with String Array Concatenation
body: <p>I'm trying to concatenate all strings in an array. I want for example <code>["a","b","c"]</code> to become <code>"abc"</code>. Here's my code:</p>
  
  <pre><code>import java.util.Scanner;
  import java.util.ArrayList;
  
  public class Laggaihop 
  {
      private static Scanner scanner = new Scanner( System.in );
      public static void main(String[] args)
      {
          System.out.print("Ange antal ord: ");
          String input = scanner.nextLine();
          int antal = Integer.parseInt(input);
          String[] ordlista;
          ordlista = new String[antal];
          for(int i = 0; i &lt; antal; i++){
              System.out.print("Ange ord: ");
              String nyttelement = scanner.nextLine();
              ordlista[i] = nyttelement;
          }
          String resultat;
          for(int i = 0; i &lt; antal; i++){
              resultat = resultat+ordlista[i];
          }
  
  
      }
  </code></pre>
  
  <p>I get the following error: </p>
  
  <pre><code>Laggaihop.java:21: error: variable resultat might not have been initialized
              resultat = resultat+ordlista[i];
  </code></pre>
  
  <p>Why is this? I <strong>have</strong> initialized the variable in the row <code>String resultat;</code></p>
  
  <p>Thanks.</p>