Doing concatenation usong concat operation in String or + operator : Can someone clear one of my doubt, I know about the immutability of String.
What will be the output and why for the below piece of code:

               String str1="my string";
               System.out.println(str1);
               System.out.println(str1.concat(" gets appended")); 
               System.out.println(str1+" getting updated");

Cause, as per my understanding str1 should not get changed due to its immutability nature. Thus, for all case output should be my string.

Thanks in advance