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 immutable? right every one knows that, my
question is it advantage or disadvantage making string
immutable?

Answer Posted / ashish balhara

The performance for String is poor as compared to String
Buffer, as internally (for eg. a simple operation like + on
String), it generates String Buffer, calls append operation
(eqvt. of + in String) & converts result back to String.
Hence extra bytecode is generated which could be done away
with.

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to compare two strings in java program?

1104


Is string thread safe in java?

1141


Why for each loop is used?

1064


What is the class in java?

1058


What is static and final keyword in java?

1073


Can list be final in java?

985


Difference difference paint() and paintcomponent()?

1049


Is empty list java?

973


Can static methods be inherited?

1103


What are the supported platforms by java programming language?

1086


What is finalize method?

1198


What are structs in java?

1116


Is java a software?

1005


Write a function to find out longest palindrome in a given string?

1117


What are the high-level thread states in java programming?

1109