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
How would you format a date in java? I.e. In the ddmmyyy format?
What is meant by class loader? How many types are there?
Can we make a constructor final?
How many ways can you break a singleton class in java?
Why Java doesn’t support multiple inheritance?
What is the equal sign?
What is the java project architecture?
Which containers use a flowlayout as their default layout in java programming?
Describe method overriding
How do you define a method?
How to do a true java ping from windows?
What is the loop in java?
What does it mean to be immutable?
Where are global variables stored?
What is the public field modifier?