"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Priety.
SCJP 6 [SCJP - Old is Gold]
Ram Narayan.M wrote:its a costly one since object always persist in heap... If many string literals are created like this, Program will be running out of memory... Second format is best comparing to first one...
SCJP 6 [SCJP - Old is Gold]
Ram Narayan.M wrote:So, str and str1 reference variables refer to the same "java" string literal in the literal pool... right?
OCPJP 6
Ram Narayan.M wrote:So, String a="abc";
its a costly one since object always persist in heap... If many string literals are created like this, Program will be running out of memory... Second format is best comparing to first one....
OCPJP 6
SCJP 6 [SCJP - Old is Gold]
OCPJP 6
I do some of my very best work in water. Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|