@@ -0,0 +1,645 @@
+/**%0A * @file JSONEncodeDemo.java%0A * @author Valery Samovich%0A * @version 1.0.0%0A * @date 11/19/2014%0A * %0A * Following example to encode JSON Object using Java JSONObject with is %0A * subclass of java.util.HashMap.%0A */%0A%0Apackage com.valerysamovich.java.advanced.json;%0A%0Aimport org.json.simple.JSONObject;%0A%0Apublic class JSONEncodeDemo %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        JSONObject obj = new JSONObject();%0A        %0A        obj.put(%22name%22, %22foo%22);%0A        obj.put(%22num%22, new Integer(100));%0A        obj.put(%22balance%22, new Double(1000.21));%0A        obj.put(%22is_vip%22, new Boolean(true));%0A        %0A        System.out.print(obj);%0A    %7D%0A%7D%0A

Add Encoding JSON in Java Example