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 / parameswaran m
The StringBuilder one is slightly more efficient and uses
less memory. In practice, it is unlikely to make enough of a
difference to matter either way.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is jvm? Why is java called the platform independent programming language?
what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread
Describe what happens when an object is created in java ?
What is a cup of java?
How to add menushortcut to menu item?
What is comparator in java?
How would overload a function based on return type?
Can you explain inner class.
What is hashing in java?
What is the use of list in java?
What is the base class for error and exception?
What is volatile data type?
How many bytes is a unicode character?
What are 3 data types?
When will you define a method as static in Java?