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
What is compiler and what its output.
Can we override private method in java?
Can we restart a thread already started in java?
What is autoboxing and unboxing?
Is it compulsory for a try block to be followed by a catch block in java for exception handling?
How do you identify independent and dependent variables?
What do you mean by default constructor in java?
What are the pillars of java?
What is files manifesting?
What are static methods?
How do you sort in descending order in java using collections sort?
What kind of variables a class can consist of?
How do you invoke a method?
What is your platform’s default character encoding?
How to change value in arraylist java?