Why String Is Immutable In Java | String Immutable Concept In Java | String Concept In Java

Publicado em: 26 Julho 2020
no canal de: Pawan S Nair
6,793
128

String In Java | String Advanced Concepts | What Is Heap Memory And String Constant Pool (SCP)
   • String In Java | String Advanced Concepts ...  

follow me on:
Facebook:   / pawans.nair.7  
Instagram:   / pawan_s_nair  
Twitter:   / pawannair  
Linked in:   / pawan-nair-669860168  

In This video, we will discuss why string is immutable

Immutable means which can't be changed, In the same way in java when we create an object of string class we can't change the content of the object even if we perform concat operation on the string reference variable.

When we use any string reference variable we perform concat operation we actually create a new object at run time and all these objects that are created at run time will be in heap memory.

But still, the reference variable that was created earlier is pointing to the previous object and the new object is not having any reference,
so even if we perform any kind of operation in string object it will create a new object at runtime. If we use the same reference variable still the object remains the same unchanged.


Nesta página do site você pode assistir ao vídeo on-line Why String Is Immutable In Java | String Immutable Concept In Java | String Concept In Java duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Pawan S Nair 26 Julho 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 6,793 vezes e gostou 128 espectadores. Boa visualização!