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

StringBuilder s = new StringBuilder("Hello
Mom");s.append(",I mean,Mother");
Response.Write(s.ToString());


String s = "Hello Mom";
s+ = ",I mean Mom";
Response.Write(s);

Which is faster ? which uses the most memory?

Answer Posted / prasanta khandai

Actually what happens if u add two strings like second one,
then internally it uses the String Builder to call the
append method to add and it converted into the strings again.

so first one is the faster as it appended right ways.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is adapter in java?

927


Explain the purpose of garbage collection in Java?

1033


What is thread count in java?

1014


What is the purpose of sizeof operator?

1057


Can we restart a dead thread in java?

987


What does this () mean in constructor chaining concept?

1125


Is null keyword in java?

947


What is difference between filereader and bufferedreader?

963


What is exception hierarchy in java?

1013


How do you sort data in java?

958


What is the purpose of a transient variable?

1071


What is extension method in java?

1047


What is the history of java?

1003


Why bytecode is called bytecode?

1214


What is collections framework?

1155