Skip to content

Instantly share code, notes, and snippets.

public class StringBuilderExample {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
// Append strings
sb.append("Welcome").append(' ').append("to").append(' ').append("Chankok.com");
System.out.println("Append strings : " + sb.toString());
@chankok
chankok / countries.json
Last active October 5, 2016 10:43
A JSON file with a list of country names and country codes (ISO Alpha-2)
[
{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Albania",
"code": "AL"
},
{
public class StringBufferExample {
public static void main(String[] args) {
StringBuffer strBuf = new StringBuffer();
// Append strings
strBuf.append("Welcome").append(' ').append("to").append(' ').append("Chankok.com");
System.out.println("Append strings : " + strBuf.toString());