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 the use of singleton?
What is bean? Where it can be used?
Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?
What are different types of arrays?
What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?
What is jrmp?
What is the purpose class.forname method?
What is a jit compiler?
can rmi and corba based applications interact ?
What is a java string?
What is module with example?
What is java command?
Why is java architectural neutral?
How many types of classes are there in java?
What does file separator do in java?