String Buffer¶
Examples¶
Java¶
public String joinWords(String[] words) {
String sentence = "";
for (String w : words) {
sentence = sentence + w;
}
return sentence;
}
public String joinWords(String[] words) {
StringBuffer sentence = new StringBuffer();
for (String w : words) {
sentence.append(w);
}
return sentence.toString();
}