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 are the methods in object?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
What is the set interface in java programming?
What is method overriding in java ?
What is assembly used for?
What is the difference between a choice and a list?
What is the difference between dom and sax parser in java?
What is method and methodology?
Which arithmetic operations can result in the throwing of an arithmeticexception?
What is singletonlist in java?
What is java abstraction with example?
What is the core java?
What are the 4 versions of java?
How would you format a date in java? I.e. In the ddmmyyy format?
What are different types of arrays?