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 purpose of using rmisecuritymanager in rmi?
Define immutable object?
Why is a constant variable important?
What is finalize() function in java?
Why hashmap is used in java?
What is difference between == and === in js?
How many inner classes can a class have?
What is tostring () method?
Which non-unicode letter characters may be used as the first character of an identifier?
What is package protected in java?
What is json parser in java?
What two classes are used to read data only?
How do you use parseint in java?
What do you mean by constructor?
What is the use of toarray () in java?