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 / anil kumar khichar

Immutable means the original String never get changed or
replaced by another one. You can simply concate another one
, but beware you can't replace it. Look at the following:-


{
String s="kapil";
String s1="raj";
String s=s1;

see here if you assign s1 to s ,there will you get error.
And it's not allowed here. So we can say Strings are immutable.

Thanks!
Anil

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define packages in java?

944


What is a java object and java application?

985


Is void a type?

927


Why are the objects immutable in java?

935


Which is dependent variable?

836


How many bytes is a string?

1079


What is the use of jtable?

1059


What are different types of encoding?

1031


How would you format a date in java? I.e. In the ddmmyyy format?

1316


What does the “static” keyword mean? Can you override private or static method in java?

1037


What is the reason behind using constructors and destructors?

1002


What are the parts of a method?

931


What do you mean by data type?

966


What is multi-catch block in java?

1015


Give us the name of the list layoutmanagers in java?

874