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
what is daemon thread and which method is used to create the daemon thread? : Java thread
What does += mean coding?
What are desktop procedures?
Why we use methods in java?
Why method overriding is used?
What is anagram of a string?
Give example to differentiate between call by value and call by reference.
What are the six ways to use this keyword?
What is the purpose of a default constructor?
Can a top level class be private or protected?
Can we create object of static class?
Is empty string in java?
what are the high-level thread states? : Java thread
What is vector capacity in java?
What is general methodology?