Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is set and get methods in java?

1043


Why java is made?

1020


What is :: operator in java 8?

1079


Can a class extends itself in java?

1072


Is string a class?

1095


What is a type parameter in java?

1062


Difference between static synchronization vs. Instance synchronization?

1173


What is fail first in java?

1295


Does importing a package imports its sub-packages as well in java?

1014


Distinguish between a predicate and a function?

1046


Can we override private method?

1129


What is the method to declare member of a class static?

1056


What are the different collection views provided by maps?

1043


How to instantiate member inner class?

1147


What is the use of static class?

1278