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

If an application has multiple classes in it, is it okay to have a main method in more than one class?

1063


What is package protected in java?

1029


Is it necessary that each try block must be followed by a catch block?

1076


What is rmi and steps involved in developing an rmi object?

1115


How do you achieve singleton?

1031


Objects or references which of them gets garbage collected?

1019


What is the difference between multiple processes and multiple threads?

1295


Where pragma is used?

1099


What are reference variables in java?

1181


what is thread? : Java thread

1042


Why stringbuilder is not thread safe in java?

1073


What is an arraylist in java?

1164


What is the difference between an array and an array list?

1086


Tell some latest versions in JAVA related areas?

1044


Is sizeof a preprocessor?

1045