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
Can long be null in java?
Why singleton class is used in java?
What are the 8 primitive data types in java?
What differences exist between iterator and listiterator?
How many bytes is 255 characters?
Why is it called a string?
What is a qms manual?
What is the parse method in java?
What is bufferedwriter?
What are different access specifiers in java? Explain
Is treeset sorted in java?
When throw keyword is used?
What is the major advantage of external iteration over internal iteration?
Variable of the boolean type is automatically initialized as?
When should I use a singleton?