String in Java - Never like before!

Veröffentlicht am: 17 Februar 2018
auf dem Kanal: 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.


Auf dieser Seite können Sie das Online-Video String in Java - Never like before! mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Sudipto Roy 17 Februar 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 239 Mal angesehen und es wurde von 7 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!