Skip to content

Instantly share code, notes, and snippets.

@dangnhdev
Created February 7, 2016 04:53
Show Gist options
  • Save dangnhdev/05a1025508c9a96732b3 to your computer and use it in GitHub Desktop.
Save dangnhdev/05a1025508c9a96732b3 to your computer and use it in GitHub Desktop.
/**
*
* @author NguyenHaiDang@ActiveStudy
*/
public class StringJoinerExample {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
sb.append("Hello").append(" ").append("World"); //có thể nối liên tiếp
String s = sb.toString(); //phải gọi toString() để lấy chuỗi ta cần
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment