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 pre increment and post increment in java?

973


What is the difference between preemptive scheduling and time slicing?

1053


What are adapter classes?

1027


Explain list interface?

946


How do you replace a string in java?

992


What is the requirement of thread in java?

1027


Explain what is Marker interface?

1071


What are the Main functions of Java?

1078


How we can run a jar file through command prompt in java?

951


State the merge-sort principle and its time complexity.

966


What is cr keyboard?

1221


How do you insert a line break?

895


What is number data type?

1012


What does int [] mean in java?

1020


What is the difference between Java1.4 and Java1.5

2295