String in Java - Never like before!

Publié le: 17 février 2018
sur la chaîne: Sudipto Roy
239
7

Awesome explanation of String internals in Java with memory concept!
There are two ways to create String object:
By string literal
By new keyword
String Constant Pool is a collection of references to String objects.
Strings, are immutable, are objects like any other in Java. Objects are created on the heap and so are Strings.
So, Strings that are part of the String Literal Pool live on the heap, but they have references to them from the String Literal Pool.
When a .java file is compiled into a .class file, any String literal is noted in a special way.
On finding one, it checks to see if an equivalent String is already referenced from the heap.Once a reference is made to that String object, any references to that String literal throughout the program are replaced with the reference to the object referenced from the String Literal Pool.


Sur cette page du site, vous pouvez voir la vidéo en ligne String in Java - Never like before! durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Sudipto Roy 17 février 2018, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 239 fois et il a aimé 7 téléspectateurs. Bon visionnage!