Sir, this big concept got know after many years! thanks a lot!
@shubhamgaygol6737 Жыл бұрын
Sir in last example As For DURGA is a string constant so in SCP also object copy created
@Anonymous-sh8kc3 жыл бұрын
my doubt is, when you create String s2 = s1.lowerCase(); why it doesn't point to the object in SCP but it points to the object in Heap despite both are the same valued object. isn't SCP supposed to be searched first by JVM ? please explain Sir Respect from Canada.
@DurgaSoftwareSolutions3 жыл бұрын
Hello Friend. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
@raghipandit6624 Жыл бұрын
good question. I am wondering the same.
@Arun-zy8wi Жыл бұрын
Great teacher ❤
@premabhisek5 жыл бұрын
Thanks for sharing. I just have 1 question in regards to the s1.toUpperCase() statement. Any new object that gets created during runtime, goes into heap area. However once any new string that gets created in heap, the same gets created in string constant pool too. If my understanding is correct, then once "DURGA" gets created in heap, will "DURGA" get created in SCP too?? Please correct me if I am wrong..
@DurgaSoftwareSolutions5 жыл бұрын
Hello Abhishek. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
@rohitmehta38125 жыл бұрын
"DURGA" would be created under heap only because it gets created at runtime, if a new operator is used i.e String s=new String("DURGA"); then only objects would be created on heap as well as under SCP
@sandeepg53874 жыл бұрын
Because we are not using String Literal(Constant) . We are calling a method at runtime. Hence it wont be created in SCP. Compiler will add string constants to SCP. Compiler wont able to predict the result of method call and hence it wont add SCP. Further, SCP is meant for string constants, hence the name String 'Constant" Pool.
@blesseddivya39352 жыл бұрын
Thank you Sir
@raghipandit6624 Жыл бұрын
Why does s3 point to durga String in Heap area and not SCP area? Anyone? 7:01 timestamp
@raghipandit6624 Жыл бұрын
I think it is because if there is no change in the object ( in s1.toLowerCase() ) then the existing object (that was initially created in Heap) is used. If s1 would have been created without the new keyword then s3 would have pointed to the object in SCP (object that gets created initially). Then both s1 and s3 would point to the same object in SCP. Make note that he says "If there is no change in the content then the existing object is used whether it is in Heap or SCP."
@raghipandit6624 Жыл бұрын
I literally answered my own question lol
@DurgaSoftwareSolutions Жыл бұрын
Hello Friend. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
@manikandand25414 жыл бұрын
wow sirji
@dilipgyawali17764 жыл бұрын
String s1 = new String("durga"); String s2 = s1.toUpperCase(); String s3 = s2.toLowerCase(); System.out.println(s1==s2); System.out.println(s1==s3); what will happen in this case??? please explain.
@DurgaSoftwareSolutions4 жыл бұрын
Hello Dilip. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
@gavravdhongadi98244 жыл бұрын
In the first like itself it will create an object in the heap as well as in SCP
@bhavyamadaan71094 жыл бұрын
Output: - False False Because According to the first line object is created in heap and scp S1->durga(heap) durga(scp) According to the 2nd line S2-> DURGA(HEAP) because object os created in heap at runtime Then the content of s2 is changing So new object will created in heap S3->durga
@sidhantsatapathy86033 жыл бұрын
@@bhavyamadaan7109 right
@naseehashahjahan22663 жыл бұрын
false true
@krishnamoorthi15492 жыл бұрын
private void doubt() { String s1= new String ("you cannot change me"); String s2 = "you cannot"; String s3 = s2+"change me"; System.out.println(s1==s3);//false //case1 // sir first new key word s1 object create in heap area and scp area //s3 = "you cannot change me" create in run time it not pointing into s1 heap area object but same content String s4 = new String("durga"); String s5 = s4.toLowerCase(); System.out.println(s4==s5);//true //case2 //sir s4 object is create in two area heap and scp area ok // s5 = s4.toLowerCase();this is run time operation ok because of that object is create in heap area // s5 is pointing into s4 because of same content you said that in case1 s1 content and s3 content is also same then //why it not pointing into same object why i got false in answer
@DurgaSoftwareSolutions2 жыл бұрын
Hello Krishna. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
@krishnamoorthi15492 жыл бұрын
ok sir i sent a message to this mail id thanks for our replay sir thanks sir
@krishnamoorthi15492 жыл бұрын
@@DurgaSoftwareSolutions sir i have sent mail to this id please replay to my mail sir
@kananm54912 жыл бұрын
@@DurgaSoftwareSolutions sir i also have this doubt please clarify that doubt
@ravim76062 жыл бұрын
@@DurgaSoftwareSolutions sir I also have this doubt please clarify that