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
What is an inner class in java?
Discuss different types of errors that generally occur while programming.
Explain the available thread states in a high-level?
What is ‘has a’’ relationship in java?
What Is Query Throttling in java?
How to disable caching on back button of the browser?
Is a case study a method or methodology?
What is method and methodology?
Which collection is thread safe in java?
What is the use of set in java?
Does google use java?
What is role of void keyword in declaring functions?
What is jrmp?
What does system out println () do?
How many static init can you have?