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

Whats the difference between notify() and notifyall()?

1041


What is a void method?

921


How can we create a thread in java?

1025


Explain enumeration in java?

1008


Similarity and difference between static block and static method ?

919


How is string immutable in java?

1038


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

1380


What are peerless components in java programming?

1013


How many types of gc are there in java?

997


If a method is declared as protected, where may the method be accessed in java programming?

995


When do we need to use internal iteration? When do we need to use external iteration?

1126


Does printwriter create a file?

962


What happens when you add a double value to a string?

1000


What is a parameter used for?

963


What is a stack class in java ?

1106