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
Difference between collection, collection and collections in java?
What is a key in java?
What is the difference between equals() and?
What are different types of encoding?
What is treemap in java?
How does arraylist size increase in java?
How do you represent a space in regex java?
What is main string [] args?
what is ststic with example
Compare overloading and overriding?
What is a substring of a string?
What is an interface in java?
what is heap memory?
What is a hashmap used for?
What is return keyword in java?