 concatenation operator (+) vs concat()
<p>For String concatenation we can use either <code>concat()</code> or concat operator <code>(+)</code></p>

<p>I have tried the following performance test and found <code>concat()</code> is faster and memory efficient way for String concatenation. If concat() is better than operator then when to use concatenation operator <code>(+)</code></p>

<p><strong>String concatenation compression</strong> for 100000 times</p>

<pre><code>String str = null;

        //------------Using Concatenation operator-------------
        long time1 = System.currentTimeMillis();
        long freeMemory1 = Runtime.getRuntime().freeMemory();
        for(int i=0; i&lt;100000; i++){
        str = "Hi";
        str = str+" Bye";
        }
        long time2 = System.currentTimeMillis();
        long freeMemory2 = Runtime.getRuntime().freeMemory();

        long timetaken1 = time2-time1;
        long memoryTaken1 = freeMemory1 - freeMemory2;
        System.out.println("Concat operator  :"+"Time taken =" +timetaken1+" Memory Consumed ="+memoryTaken1);

        //------------Using Concat method-------------
        long time3 = System.currentTimeMillis();
        long freeMemory3 = Runtime.getRuntime().freeMemory();
        for(int j=0; j&lt;100000; j++){
        str = "Hi";
        str = str.concat(" Bye");

        }
        long time4 = System.currentTimeMillis();
        long freeMemory4 = Runtime.getRuntime().freeMemory();

        long timetaken2 = time4-time3;
        long memoryTaken2 = freeMemory3 - freeMemory4;
        System.out.println("Concat method  :"+"Time taken =" +timetaken2+" Memory Consumed ="+memoryTaken2);
</code></pre>

<p><strong>Result</strong> </p>

<pre><code>Concat operator  :Time taken =31 Memory Consumed =2259096
Concat method  :Time taken =16 Memory Consumed =299592
</code></pre>
