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 does file separator do in java?

1000


In how many ways we can create threads in java?

1189


How to display all the prime numbers between 1 and 100

994


How to display all the prime numbers between 1 and n (n is the number, get the input from user)

967


Can you override static methods?

944


What are data types in programming?

974


Can a class have a static inner class?

1060


Describe the Big-O Notation.

1032


Explain about procedural programming language or structured programming language and its features?

1077


How can we find the actual size of an object on the heap?

1291


What is collection class in java?

985


What is isa relationship?

1023


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

1088


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

994


Can we pass null as argument in java?

929