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 / ravi jain
First one is faster
because in 1st only one object is created,
but in 2nd one three objects are created.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is the empty set a singleton?
How many arguments can a method have java?
Which are the two subclasses under exception class?
What super () does in java?
Can you give few examples of final classes defined in java api?
How do I start learning java?
Define canvas?
Name and explain the types of ways which are used to pass arguments in any function in java.
How to create an immutable class?
Differentiate between static and non-static methods in java.
Does hashset allow duplicates in java?
What is abstract class constructor called?
What does %4d mean in java?
Which collection allows duplicate values in java?
What is autoboxing in java?