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 a constructor is declared private?
Can a constructor have different name than a class name in java?
when to use ArrayList and when to use HashMap in webApplication.
What are desktop procedures?
what is interface in java? Explain
What modifiers may be used with a top-level class?
What is the purpose of the return statement?
What is java instanceof operator?
Explain a few methods of overloading best practices in java?
What is singleton math?
What is assembly condition codes?
What is <> used for in java?
What is return null in java?
What access modifiers can be used for variables?
what is the difference between future and callable interface in java?