which class to use when concatenating
strings in a loop.
Answer Posted / narasimha
we any use the both classes String and StringBuffer.
but if we use StringBuffer it would be advatagebecase we
are going to create only one Object.if we use the String
class it is going to create the one for each itration.now
it up to you which one to use
Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
how to handle exceptions in ejb?
What is the difference between superclass and subclass?
What is io stream in java?
What is polymorphism and what are the types of it?
What is the meaning of find and replace?
Why java is secure? Explain.
What is a parameter in java?
What is anonymous inner class?
when to use ArrayList and when to use HashMap in webApplication.
what is comparable and comparator interface?
What is the difference between the final method and abstract method?
what is the major difference between linkedlist and arraylist in java?
How do you clear a method in java?
In the below example, how many string objects are created?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?