String in Java - Never like before!

Опубликовано: 17 Февраль 2018
на канале: 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.


На этой странице сайта вы можете посмотреть видео онлайн String in Java - Never like before! длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Sudipto Roy 17 Февраль 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 239 раз и оно понравилось 7 зрителям. Приятного просмотра!