This tutorial explains the concept of String Immutability in Java and helps us to understand why string class is made immutable.
NOTE:
The concat method will create string on heap in both cases. This is because strings are added in literal pool at class loading time by JVM. While the concat statement in both cases will be resolved at runtime and therefore, concatenated string should be on heap. In the tutorial, I was focused on explaining string immutability and missed this important point.
For detail tutorial on string watch -
• How is String interned in Java? | String I...
Nesta página do site você pode assistir ao vídeo on-line String Immutability in Java/ Immutable string in Java duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário EasyConcepts 19 Setembro 2017, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 3,656 vezes e gostou 103 espectadores. Boa visualização!