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
Write a program to check string is palindrome without using loop?
What are functions in java?
Can we have any code between try and finally blocks?
How many wrapper classes are there in java?
What is consumer in java?
What is the generic function?
What is starvation?
Can substring create new object?
How does multithreading take place on a computer with a single cpu?
What are the major drawbacks of external iteration?
What is public/private protected in java?
What is the java project architecture?
Can a class have 2 constructors?
What are the restrictions imposed on method overriding?
How are the elements of a gridbaglayout organized?