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
Can finally block be used without a catch?
What are the Main functions of Java?
What is class array in java?
How to convert string to char and vice versa?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
Why constructor has no return type?
Java.util.regex consists of which classes?
How many types of threads are there in java?
Mention some features of java?
What is re-factoring in software?
How does regex work?
Can you instantiate the math class in Java?
Explain the concept of hashtables?
Is it possible to use Semaphore/ Mutex in an Interrupt Handler?
Explain runtime exceptions?