When I define a StringBuffer
variable with new
, this string is not added to the String pool, right?
Now, when I define another StringBuffer
but not with new
, I define it as StrPrev.append("XXX")
suddenly it is.(or so says my college teacher). Why is that? What makes this string to suddenly become a string-pool string?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…