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 are the different ways of implementing thread? Which one is more advantageous?
Why we do exception handling in java and how many types of exceptions are there?
Explain the difference between protected and default access.
Why collection is called framework in java?
How to change the priority of thread or how to set the priority of thread?
Explain wrapper classes in java?
What is locale in java?
What are the approaches that you will follow for making a program very efficient?
What is the difference between double and float variables in java?
What is a container in a gui?
Define an applet in java?
Can you make a constructor final in Java?
What are the types of inner classes (non-static nested class) used in java?
What is mvc in java?
What is core java called?