Niranjan Prasad wrote:Garbage Collection happens on Heap Memory
I don't see your point. String literals are a special case. They are handled a little different than other objects, so they are not eligible for GC.
There may be some strange, esoteric case where is it possible, but none that I am aware of.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors