Which is the best way to use for String concatenation in
Java?

Answer Posted / harshal

'+'operator is the best way to concatenate bcz by using
this operator we can concatenate more than two strings.
This is not possible by using concat method.
But performanace wise "append" is better than "+".

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can an object be null?

543


Explain the difference between serializable and externalizable in java?

535


What is dynamic binding(late binding)?

582


What are extraneous variables examples?

521


What are the actions that can occur when a thread enters blocked state?

576






What is the dot operator?

568


What is the difference between double and float variables in java?

634


How does a for loop work?

504


Why do we use string?

576


What is a loop java?

585


What is parsing and its types?

583


What is meant by singleton class?

598


What are the two types of exceptions in java? Which are the differences between them?

508


Is ruby built on java?

529


what do you understand by the term string with respect to java?

526