Answer Posted / rakesh soni
Any Program have 'Performance' and 'Memory' issue.
1. If you want to save your 'memory' then use the 'String'
class but 'Performance' will be decrease, because every time
new object create and old object memory collect by Garbage
Collector, so performance decrease.
And
2. If you want 'Performance', than use 'StringBuffer' or
'StringBuilder' object. These class's object consume more
memory but not create new object, so 'Performance' will
increase but with memory overhead.
So take decision according your code and issue. :)
Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
What is anonymous inner class?
How do you compare two objects?
What is the size of string?
What is java virtual machine? Explain
What data type is string java?
What are drawbacks of singleton class?
What are the differences between wait() and sleep()?
How can we create a thread in java?
How will you print number in reverse (descending) order in BST.
What is the final class?
What are the differences between checked exception and unchecked exception?
What is java reflection?
What is difference between an object and a class?
What is the purpose of sizeof operator?
What does this () mean in constructor chaining concept?