title: Concatenation with arraylist
body: <p>This is my code. I know how to use the <code>concat</code> operator, but not with arrays or <code>arraylist</code>.</p>
  
  <pre><code>import java.util.*;
  class stringProject {
      static String concat(String str1, String str2) {
          return str1.concat(str2);
      }
  
      public static void main(String[] args) 
      {
        ArrayList&lt;String&gt; projectStrings = new ArrayList&lt;String&gt;();
        projectStrings.add("The ");
        projectStrings.add("quick ");
        projectStrings.add("brown ");
        projectStrings.add("fox ");
        projectStrings.add("jumped ");
        projectStrings.add("over ");
        projectStrings.add("the ");
        projectStrings.add("lazy ");
        projectStrings.add("dog.");
      }
      System.out.println(projectStrings.get(1).concat(projectStrings.get(0)));
      }
  }
  </code></pre>
  
  <p>And my errors are:</p>
  
  <pre><code>File: C:\Users\Daniel\stringProject.java  [line: 23]
  Error: Syntax error on token "println", Identifier expected after this token
  File: C:\Users\Daniel\stringProject.java  [line: 23]
  Error: Syntax error on tokens, AnnotationName expected instead
  File: C:\Users\Daniel\stringProject.java  [line: 23]
  Error: Syntax error on token ")", delete this token
  File: C:\Users\Daniel\stringProject.java  [line: 23]
  Error: Syntax error, insert "Type VariableDeclaratorId" to complete FormalParameter
  File: C:\Users\Daniel\stringProject.java  [line: 23]
  Error: Syntax error, insert ")" to complete MethodDeclaration
  File: C:\Users\Daniel\stringProject.java  [line: 25]
  Error: Syntax error on token "}", delete this token
  </code></pre>