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

Answer Posted / leo zhao

Hi Manasa,

You can use append to concatenate more than 2 strings, such as

StringBuffer str = new StringBuffer("Stanford ");
str.append("Lost!!").append(" again.");

Is This Answer Correct ?    18 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What the difference is between execute, execute Query, execute Update?

380


What is flag in python?

559


Can you give few examples of final classes defined in java api?

569


What are format specifiers in java?

608


What is data and its types?

578






What does index mean in java?

544


What is meant by structural programming?

555


Name four container classes.

561


Can we have 2 main methods in java class?

543


What is the latest version of java?

589


Is void a type?

587


What is the driver class?

569


What is try-with-resources in java?

622


How many types of gc are there in java?

572


What is meant by singleton class?

604