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 / ramaraju
hi
String is a Immutable object,that is
string is an object not a datatype variable.
From the above example
String s=s1 //means it will create a new objet s with the
value raj,not change the value.
Note:whenever u edit or concatinate the string internally
it will create a new object,but not chang that object.
Is This Answer Correct ? | 16 Yes | 4 No |
Post New Answer View All Answers
How infinite loop is declared?
How do you do math powers in java?
What is meant by data hiding in java?
Can we serialize singleton class?
What exactly is java?
Can the interface be final?
Define inheritance?
How many threads does a core java have?
Does java have extension methods?
What are data types in oop?
What is time complexity algorithm?
What is dynamic array in java?
Using callable statement how can you pass out parameters, explain with example?
What is sizeof () operator?
What is a class object?