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 happens if an exception is throws from an object's destructor?
Can we nested try statements in java?
What is sizeof () operator?
Why destructor is not used in java?
How to overcome the exception object reference not set to an instance of object?
What is java util function?
How can you add and remove nodes in jtree?
Can static method access instance variables ?
What does string [] args mean?
What is a final class in java?
If a method is declared as protected, where may the method be accessed?
What is string in java with example?
What is the difference between state-based unit testing and interaction-based unit testing?
What is a default constructor and also define copy contrucyor?
what is thread? : Java thread