Q1 My doubt is
why not A option is true
Q2
How many String objects are created when we run the following code.
String s1,s2,s3,s4;
s1 = "Hello";s2 = s1; s3 = s2 + "Pal";s4 = s3;
A.1
B.2
C.3
D.4
E.0[/QB]
For Q1, in my opinion, answer choice A is not correct because they have mentioned it can be applied to classes..
the staic modifier cannot be applied to classes, unless the class is inner (again not method-local). The answer choice simply says "classes" which certainly is not true.
For Q2 mu answer is Option C.
First String object ---> "Hello"
Second String object ---> "Pal"
Third String object ---> "HelloPal"
pls anyone correct me if I am wrong...
[ July 14, 2006: Message edited by: Suhas Wadadekar ]