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
What is the impact of declaring a method as final?
How do you remove duplicates in java?
Difference between Preemptive scheduling vs. Time slicing?
What is string [] java?
What is api in java?
What does system out println () do?
What are the differences between the constructors and methods?
What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?
How does class forname work in java?
What is starvation?
What do you mean by formatting?
How do you convert an int to a string in java?
What is the benefit of inner / nested classes ?
How can we avoid including a header more than once?
What are streams?