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 are adapter classes?
Can java arraylist hold different types?
How would you convert bytes to string?
Which of the following classes will have more memory allocated?
What is a double?
What is the java project architecture?
What is final, finally, finalize?
What state is a thread in when it is executing?
What is oop in java?
Why is whitespace important?
Can a class extend more than one class?
Is null function in java?
How to perform binary search in java?
What is a nested structure?
What is 16 bits called?