Why string is immutable in java || The 4 reasons you must know || part 1

Описание к видео Why string is immutable in java || The 4 reasons you must know || part 1

Well, Why String pool? What is the need of String pool in java? How is string being an immutable class helping us optimizing the memory uses in java?

That's what we are going to learn in this tutorial.We are going to cover one of the most common FAQ why String is immutable in java? There is not a single reason for this.String class is designed as an immutable class by keeping different things in mind.Today we are going to cover one of the most important reasons why the string is immutable.

Immutable classes object doesn’t change their state.The string being immutable can’t be modified once string object is created.One of the reasons why it is possible to have a string pool inside the heap memory.In string pool, once an object is created, it is cached in the memory.After that, no object with the same content will not be allowed to the string pool as duplicates are not allowed inside string constant pool.Multiple strings can be referred to the object which been created inside the string constant pool which helps us to optimize memory and help us to stop creating tons of object.

String pool implementation is one of the biggest reason why the string is immutable in java.

We are also going to learn about how to intern an object inside string pool in this tutorial.

In the next video, we are going learn about one of another reason why the string is immutable.I am talking about string hashcode caching here.The reason why we can use string a key in the hashmap.

Below link will redirect you the next tutorial
String hashcode caching (One of the biggest reason why the string is immutable)
   • This is why string is immutable in Ja...  

I recommend you to watch the hashmap internal implementation video of mine before going further, with this series.below is the link :

   • Hashmap Internal working  


subscribe to my channel by clicking on the link below.

   / @seleniumexpress  

Stay tuned and like my Facebook page for more.

  / seleniumexpress  


Music :
-----------
credits : -
(intro)
1)
Adventures by A Himitsu   / a-himitsu  
Creative Commons — Attribution 3.0 Unported— CC BY 3.0
http://creativecommons.org/licenses/b...
Music released by Argofox    • A Himitsu - Adventures [Royalty Free ...  
Music provided by Audio Library    • Adventures – A Himitsu (No Copyright ...  

-----

intro template :
wwww.youtube.com/Alexbau01

Комментарии

Информация по комментариям в разработке