Hi.. pl help me with the foll qn. How many String literals are created when the foll code is executed and run? String s1, s2,s3,s4 ; s1 = "hello"; s2 = s1; s3 = s2+"pal"; s4 = s3; A. 1 B. 2 C. 3 D. 4 E. Can't say IMO since only s1 and s3 are created,and the rest are assigned, the answer is B. Am I right? please help me.. thanks, Ramani.
posted 16 years ago
"pal" is also a literal that gets created in addition to s1 and s3.