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
How do I get 64 bit java?
What are basic keywords?
What is identifier in java?
How do you ensure that n threads can access n resources without deadlock?
How are observer and observable used in java programming?
What is the static import?
What is stringwriter?
What is public static void main?
Highest level event class of the event-delegation model?
What are some alternatives to inheritance?
If try block is successfully executed, Then Is Finally block executed?
Does a function need a return?
Which oo concept is achieved by using overloading and overriding?
What are inbuilt functions?
What is the old name of java?