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 you stop a thread in java?
What is a priority queue java?
How many threads can java run?
Differentiate between == and equals().
Explain the difference between protected and default access.
Does java runtime require a license?
What is a parameter example?
What is the byte order of byte buffer?
What is arraylist e?
Is there any limitation of using inheritance?
What is bifunction in java?
How to sort double array in java?
Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.
Why to use nested classes in java?
What is void in java?