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 is the format specifier?
What is array and arraylist in java?
placement papaers of spring computing technology
How do you do a line break in java?
What is the use of :: in java?
Differentiate between class and structure.
What are Normalization Rules? Define Normalization?
What is difference between path and classpath in java?
Tell me a few examples of final classes defined in Java API?
What is the difference between iterator and enumeration ?
What is a prefix function.write down a code to compute prefix function.
When will we prefer to use set and list in java and why?
What is data and its types?
How do you compare values in java?
Explain reverse a linked list recursive java solution?