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
Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain
What is public static void main?
What are the uses of java?
What is the importance of hashcode() and equals() methods?
How many techniques can be employed to create a string object?
What is assembly used for?
What is compareto?
How to display all the prime numbers between 1 and 100
How do you write methodology?
What is ‘has a’’ relationship in java?
What does method mean?
How do you compare objects in java?
Is string an object?
Can a class be declared as protected?
When object is created and destroyed?