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 use of static method?

1101


Explain where variables are created in memory?

1057


What is the difference amongst jvm spec, jvm implementation, jvm runtime ?

1021


What is array command?

1266


What are inner classes or non static nested classes in java?

1218


Can an abstract class be a final class?

1047


How to declare objects of a class ?

1129


What are the properties of thread?

969


Name few "optional" classes introduced with java 8 ?

1187


What are the differences between heap and stack memory?

1147


What is diamond operator in java?

1025


why we use merge option in hybernate pls give a ex snippet

2032


Can we have two methods in a class with the same name?

1113


What is t type java?

1109


How do you generate random numbers in java?

1071