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
Explain the difference between call by refrence and call by value?
What are wrapped classes in java programming?
Define max and min heap, also the search time of heap.
When the constructor of a class is invoked?
How many boolean functions are there?
What are methods and how are they defined?
Is this valid in java ? Can we instantiate interface in java?
What is the size of boolean variable?
What is the return type of the main method?
What are the different types of java?
Explain illegalmonitorstateexception and when it will be thrown?
What is a dynamic array in java?
What are the main differences between the java platform and other platforms?
Write a program to print all permutations of string?
What is the purpose of lambda expressions?