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 the synchronized method modifier?
What is the difference between abstract classes and interfaces?
What does a boolean method return?
How will you reverse a singly-link list?
Will the jvm load the package twice at runtime?
What is meant by data hiding/encapsulation?
What is string literal in java?
What is the return type of the main method?
What are the 6 boolean operators?
Which is better 64 bit or 32 bit?
What is ascii format?
When should you use arraylist and when should you use linkedlist?
What happens if an exception is not handled in a program?
What is keyword and identifier?
I want to persist data of objects for later use. What is the best approach to do so?