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 the purpose of using break in each case of switch statement?

958


what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread

928


What is a heavyweight component?

977


What are loops in java?

1159


What are the differences between heap and stack memory in java?

997


What is a prefix function.write down a code to compute prefix function.

1002


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

1119


Can an object be null?

913


Can we clone singleton object?

1008


What is string immutability?

1025


What is meant by bytecode?

964


How to use arraylist in java netbeans?

975


What two classes are used to read data only?

1034


Which is better list or arraylist in java?

809


What is the main use of generics in java?

918