String Pool in Java | How many String object with String s = new String('ABC').

preview_player
Показать описание
How many String object String s = new String("ABC") will create and Concept of String pool
Рекомендации по теме
Комментарии
Автор

Great content, but the BGM is distracting,

stholy
Автор

Thanks for crystal clear explanation... 🙏🙏🙏

sandipkankate
Автор

Well explained!!! There's no such kind videos or material available...👍😊

anantyadav
Автор

Nice, keep posting videos like this. Thanks.

pep
Автор

Best video about String Pool. You earned my subscribe, thanks!

rpfallegro
Автор

Constant pool is created in the JVM's *MEMORY AREA* and not in the heap. Objects placed in heap without a reference are garbage collected!

ambidextrousTrades
Автор

I got the same ques in sapient interview as to how many objects are created ?

FoodieSanjana
Автор

It's a great content nice explanation. thank you. keep going on.

harishks.kumar.
Автор

Clearly explain but keep in mind that what u written on board is clearly visible. The text is hidden behind u

sagarawasare
Автор

not bad at all, I understood string pools better. subbed!

xTenzSlays
Автор

Well done sir but the music is a little too high for me.

clement
Автор

Why is "s" referring to heap (outside of pool) the first time "ABC" is created, but when "BCD" is created, s3 points to pool?

swagatpatra
Автор

This is incorrect! With the new operator, a new strong object is created the heap with whatever value you pass to the constructor.
The string is interned only if you use the intern () method.

umessi
Автор

Which method of creating strings is best and why?
String s = new String("ABC") or
String s = "ABC";

rashmipatil
Автор

i am not sure this correct, why we need string Intern() method, then..

jenishmoses
Автор

Hi Sir, very well explained, what if you do something like this ?

String s1 = "<value>";
String s2 = "</value>"; // By this moment we have 2 strings in the string pool
String s3 = s1 + value + s2;

Will a new string be placed in string pool for each different given value ? Thanks.

diegoramos
Автор

if the String pool becomes full -- how JVM will delete or flash the strings from Constant Pooling

JohnWick-zcli
Автор

I think scpa in heap like hashtable, so it will store value as well reference, so next time with same literal it will return the already available reference from scpa, am I right?

ManishPatel-pukg
Автор

What would happen in this scenario: if we create an object in this sequence. in the second statement, the only object will be created.. right? and the end, we would have 2 objects.
String s = "ABC";
String s1 = new String("ABC);

arunbhardwaj
Автор

hi pradeep, nice explanation. Can you show this concept using a program. Like we have two different string one in heap and other in string const pool.

AnupSingh
visit shbcf.ru