String is a immutable objects . it means that string does
not change...........
But it will be chang.........
{
String s="kapil";
String s1="raj";
String s=s1;
then print(.......)
The String has been changed ..
how it is possible and why its called immutable objects
Answer Posted / gohil
Anil Kumar Khichar is wrong there is no issue in assigning
s1 to s.
In case if you do so. Only a referenced is copied to s.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are static blocks and static initalizers in java ?
Difference between throw and throws?
What are the differences between heap and stack memory?
When should I use a singleton?
What is the difference between a vector & an array list?
What does string mean in java?
Explain creating threads by implementing runnable class?
List types of storage classes in java?
what is a green thread? : Java thread
What is meant by null and void?
How many decimal digits is 64 bit?
What is basic syntax?
What is a private class in java?
How do you compare arrays in java?
is there a separate stack for each thread in java? : Java thread