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

Can singleton class be cloned?

1050


Is arraylist ordered in java?

1109


What is mean by encoding?

1075


Can we have any code between try and finally blocks?

1013


What classes of exceptions may be caught by a catch clause in java programming?

1173


How does the java compiler work?

970


What is functional interface in java?

1043


How many types of equations are there?

1011


Explain about abstract classes in java?

1030


Can a constructor be made final?

1106


How do you compare two strings lexicographically?

929


Can we have try without catch block?

1075


Explain an algorithm to find depth of a binary tree.

1037


Explain inner classes ?

1123


Can we convert integer to string in java?

1049