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 / debapriya maity

The first one is faster

Second code snippets:3 objects are created

1:s = "Hello Mom"
2:,I mean Mom
3:Hello Mom,I mean Mom

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the exception hierarchy in java?

907


What isan abstract class and when do you use it?

1503


What is passed by reference and pass by value ?

983


How do you compare arrays in java?

881


Why string is not a wrapper class?

1132


What is the reason behind using constructors and destructors?

1002


What is formatted output in java?

893


Garbage collection in java?

948


Why is the main method declared static?

1071


Explain the selection sort algorithm and state its time complexity?

962


What is assembly used for?

963


Define how does a try statement determine which catch clause should be used to handle an exception?

1062


How do you square a number?

1165


Which one will take more memory: an int or integer?

1158


Do I need java on my computer?

921