String is an immutable object.
Then how can the following code be justified.
String s1 = ?ABC?;
String s1 = s1+?XYZ?;
s.o.p(s1);
The output is ABCXYZ, which is the value of s1 ?
Answer Posted / ramesh
Compilation ERROR
Duplicate Variable s1.
Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
Why we cannot override static method?
What is method overloading with type promotion?
what do you mean by marker interface in java?
How do I convert a string to an int in java?
Describe method overriding
How will you initialize an Applet?
Explain java coding standards for interfaces?
Why string is not thread safe?
How thread scheduler schedule the task?
What is final int?
Is 0 true or false in java?
which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?
how to handle exceptions in ejb?
Is java map thread safe?
Can a class with private constructor be extended?