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 do you create a null object?
What do you understand by classes in java?
How can we make string upper case or lower case?
How do you sort a string in java?
What is string in java with example?
What is array length in java?
Why do we use variables?
Can you pass functions in java?
Give differences between Quicksort & Mergesort. When should these sorts be used and what is their running time?
what is synchronization and why is it important? : Java thread
What is super keyword explain with example?
Where import statement is used in a java program?
Which keyword specify that a variable is effectively final ?
How to Sort Strings which are given in List and display in ascending order without using java api.
Does garbage collection occur in permanent generation space in jvm?