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 is use of static method?
What are the advantages of defining packages in java?
What is :: operator in java 8?
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
How does arraylist size increase in java?
What are the important features of Java 8 release?
What is a qualifier in a sentence?
Is java a pure object oriented language?
Can we sort set in java?
Can I extend singleton class in java?
Can we able to pass objects as an arguments in java?
What is method and methodology?
Mention a package that is used for linked list class in java.
What is lambda in java?
What are wrapper classes in java?