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

Difference between String & StringBuffer

Answer Posted / niranjanravi

String objects are constants and immutable where as
StringBuffer objects are not.StringBuffer Class supports
growable and modifiable string where as String class
supports constant strings. Strings once created we cant
modify them. Any such attempt will lead to the creation of
new strings.Where as StingBuffer objects after creation
also can be able to delete oo append any characteres to
it.String values are resolved at run time where as
StringBuffer valuesc are resolved at compile time.So if you
know the exact size of the string to be appended it is
better to go for String objects.

Is This Answer Correct ?    194 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of the system class in java programming?

1181


Is java pass by value or pass by reference?

1028


What is the base class of all exception classes in java?

1105


How do you differentiate abstract class from interface?

1009


What is a lightweight component?

1062


What is method in java with example?

999


Is there any case when finally will not be executed?

1000


What is isa relationship?

1105


Write a java program that prints all the values given at command-line.

1052


What is singleton class example?

1083


What is hasnext in java?

1061


Can we override constructor in java?

1136


Give few difference between constructor and method?

1021


I want to store more than 10 objects in a remote server? Which methodology will follow?

3266


What is the largest data type in java?

1016