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 | 2 No |
Post New Answer View All Answers
What are the skills required for core java?
Difference between a class and an object?
Differentiate between array list and vector in java.
Why hashmap is used in java?
How do you use nextline in java?
What is class and object in java?
How big is a pointer?
What is the use of static class?
What are strings in physics?
What is the independent variable in an experiment?
What does business logic mean?
Where is the singleton class used?
How many types of variables are there?
Explain what access modifiers can be used for methods?
What is the private method modifier?