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

what is static import in java? Explain

795


What is a dot notation?

781


Does java map allow duplicates?

675


Why arraylist is not synchronized in java example?

701


Give reasons supporting that string is immutable.

727


Can we override private method?

830


What is the console in java?

920


What is boolean flag in java?

809


What is the covariant return type?

787


What is difference between ++ I and I ++ in java?

726


Define reflection.

763


How to convert string to char and vice versa?

749


What is used of static keyword in java?

786


Can we declare a class as static?

812


what is daemon thread and which method is used to create the daemon thread? : Java thread

761