which class to use when concatenating
strings in a loop.

Answers were Sorted based on User's Feedback



which class to use when concatenating strings in a loop...

Answer / geeta

StringBuffer

Is This Answer Correct ?    7 Yes 0 No

which class to use when concatenating strings in a loop...

Answer / sitaram

string buffer and string builder classes are used to
concatenate the two or more strings in a loop.

Is This Answer Correct ?    1 Yes 0 No

which class to use when concatenating strings in a loop...

Answer / 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

More Core Java Interview Questions

Why Over riding is Run Time Polymorphism?

3 Answers   Genpact,


Explain OOPs concept.

0 Answers   Syntel, Visa,


How to print nodes of a Binary tree?

1 Answers   TCS,


What is Generic in java? Where can we write Generic ( class or method or objects or etc...)? with simple example? Thanks, Bose.

2 Answers   Infosys, Tech Mahindra,


Can we use catch statement for checked exceptions?

0 Answers  






Does printwriter create a file?

0 Answers  


What is static keyword?

0 Answers  


How to sort array in descending order in java?

0 Answers  


as we know a static method could access static data and static method only. then how could main method call the object of aclass which is not static and other non static data

1 Answers  


how to handle exceptions in core applications?

2 Answers   CSS,


Which is dependent variable?

0 Answers  


What are advantages of exception handling in java?

0 Answers  


Categories