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 reflection?
What state is a thread in when it is executing?
What is parsing a string?
How do you escape a string?
What comes to mind when someone mentions a shallow copy in java?
What is the difference between and ?
describe synchronization in respect to multithreading? : Java thread
What is the difference between member variables initialization and assignment in a constructor?
Explain the differences between abstraction and encapsulation?
Tell us something about an iterator.
Will the jvm load the package twice at runtime?
Which are different kinds of source code?
What are triggers in DB? Explain their types. How do they work?
What is a boolean output?
Difference between predicate, supplier and consumer ?