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...

what is mutability?which one is mutable String or StringBuffer?and why?give
examples of each which shows the mutability of each String or StringBuffer

Answer Posted / arjunkumar

Mutability means data which we can change.
StringBuffer class is mutable, because it can change its
data where as String class cant.
Example:
If you want to combine two strings we have two methods i.e
append() method and concat() method.
here append() is used to append the 2nd string to 1st string
and it can store in memory. where as concat() method is
combine the 2nd string to 1st string but it is not actuly
stored in memory it just show to us as combind

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the constructor and how many types of constructors are used in java?

1036


What is an argument in java?

983


What java ide should I use?

1044


If we don’t want some of the fields not to serialize how to do that?

1062


What is the platform?

1051


What is finalize()? Is finalize() similar to a destructor?

1003


What is the protected method modifier?

1085


How can you avoid serialization in child class if the base class is implementing the serializable interface?

1123


Can you pass functions in java?

1073


What are use cases?

1013


What are the methods used to implement for the key object in the hash map?

1086


What are annotations in java?

1134


What is the exact difference in between unicast and multicast object? Where we will use?

1041


What is static synchronization?

1156


What is a generic code?

1127