Code example for Map

Methods: isEmptykeySet

     * Returns an array containing the string names in this object. This method 
     * returns null if this object contains no mappings. 
    public JSONArray names() {
        return nameValuePairs.isEmpty()
                ? null 
                : new JSONArray(new ArrayList<String>(nameValuePairs.keySet()));
     * Encodes this object as a compact JSON string, such as: 
     * <pre>{"query":"Pizza","locations":[94043,90210]}</pre> 
    @Override public String toString() {
        try { 
            JSONStringer stringer = new JSONStringer();
            return stringer.toString();
        } catch (JSONException e) {
Stop searching for code, let great code find you!  Add Codota to your java IDE