Deepa Natarajan
August 14th, 1999, 10:48 PM
Q.1
public class Quest{
public static void main(String[] arg){
String s1 ="abc";
String s2 ="def";
String s3 =s1.concat(s2.toUpperCase());
system.out.println(s1+s2+s3);
}
}
Ans. abcdefabcDEF - I got this answer and it contradicts with the concept that String Objects are immutable.
How does it work?
Thanks,
Deepa
public class Quest{
public static void main(String[] arg){
String s1 ="abc";
String s2 ="def";
String s3 =s1.concat(s2.toUpperCase());
system.out.println(s1+s2+s3);
}
}
Ans. abcdefabcDEF - I got this answer and it contradicts with the concept that String Objects are immutable.
How does it work?
Thanks,
Deepa