9.9 String is Immutable

preview_player
Показать описание
Introduction to Java Strings, concept of immutability, creating string objects, Immutable string
Immutable means unmodifiable or unchangeable. In java string objects are immutable.The immutable objects used to improve readability and runtime efficiency in object-oriented programming. Immutable objects are inherently thread-safe.

Follow on Facebook:

Subscribe to our other channel:
Telusko Hindi :

Subscribe to the channel and learn Programming in easy way.

Рекомендации по теме
Комментарии
Автор

thank you sir fr teaching us . u r one of the great teacher ever@ navin reddy

vibinvibs
Автор

I think when you do new String ("Navin") it will create a new object 103 - Navin in the heap memory. In the video it say it will refer to the same one

dhavalshah
Автор

Hai Navin Reddy, Please give us proper answer for String memory management and String is Immutable, In interview I told answer for string immutable As you taught in this video They rejected me in first round itself.

yuvarajs
Автор

String s=new String ("syam"); if you use s.intern(); then only it points to string pool until then it points to heap.

shyamelakapalli
Автор

@0:36 When Navin says "mutability is a crime"
Me: "It's true..Corona should have been a String(immutable)"
😂🥲
April: 2021

preetird
Автор

Amazing Telusko you are such a good teacher

SurajPandey-vigr
Автор

I cant find the app in play store. Wonderful videos. Crisp and clear explanation

babithabalija
Автор

I watch complete adds on your videos, so that you can earn some money .

harithkumar
Автор

Hi navin, whenever u teach any concept could you give a program code example it will useful to understand the concept easily

harisudan
Автор

"Welcome back aliens" is immutable

AvidWanderlust
Автор

Sir can you please make a video on heap and stack memory along with a separate video on a roadmap for desktop application developers

aymanmomin
Автор

Looking you drawing on board and now all animations... That's mutable... 😁

pareshhere
Автор

owwhoo ! Telusko is always been great ! But I don't know how he had mistaken at 4:57 his new String("navin"); will create a new object on heap outside of the String Pool where 'navin' exists and this 'navin' is not that 'navin' from String Pool !

shahriarmim
Автор

I also faced name issue. People used to send or write to wrong Naveen. Nice video

NavinKumar-igxb
Автор

Creating New Strings Earlier we promised to talk more about the subtle differences between the various methods of creating a String. Let's look at a couple of examples of how a String might be created, and let's further assume that no other String objects exist in the pool:
String s = "abc"; // creates one String object and one // reference variable In this simple case, "abc" will go in the pool and s will refer to it.
String s = new String("abc"); // creates two objects, // and one reference variable In this case, because we used the new keyword, Java will create a new String object in normal (nonpool) memory, and s will refer to it. In addition, the literal "abc" will be placed in the pool.

Sumitanad
Автор

Hmm good 🙂.. But in different videos, blogs different informations 😶 which confusing me 😐. This video make sense for me a bit more. Goog.

simulink
Автор

Due to string immutability you can safely return them from functions.
If strings were mutable anyone could have changed your return value.
Thats why serialization is done also.

ankitanand
Автор

Hi, what if we do not create str1 object and change str to "Reddy". Will it also create new string in string pool or will it change/replace Navin with Reddy? If first case is true then what will happen with Navin in string pool?

muhammadomersaleem
Автор

Sorry for saying.this is wrong when ever we create string using new keyword it will never pointing to string pool it will create new string in heap .if u want to put that value into sting pool there is a method called intern()

swathikumar
Автор

String constant pool is created in Method Area not heap area. We access it by using intern () method which create object in heap area of that string.

rajatkiit