Skip to content

Instantly share code, notes, and snippets.

@s4553711
Created February 8, 2013 07:42
Show Gist options
  • Save s4553711/4737324 to your computer and use it in GitHub Desktop.
Save s4553711/4737324 to your computer and use it in GitHub Desktop.
JSON in Java
import org.json.*;
public static void main(String[] args) {
// Declare Hashtable
Hashtable stor = new Hashtable();
stor.put("Keya","a");
stor.put("keyb","b")
// Declare JSONObject and initialization with stor
JSONObject jsonObject = new JSONObject(stor);
// Output
System.println(jsonObject.toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment