Entain India interview question

how strings are stored inside memory ?

Interview Answer

Anonymous

1 Jun 2018

This part of the heap memory is called String Constant Pool. Whenever you create a string object using string literal, that object is stored in the string constant pool and whenever you create a string object using new keyword, such object is stored in the heap memory.