Java tutorial
//package com.java2s; import java.util.*; public class Main { private static String buildQueryString(String method) { return "?qry=".concat(method); } private static String buildQueryString(String method, Map<String, String> args) { String qry = buildQueryString(method); Iterator it = args.entrySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); String val = args.get(key); qry = qry.concat("?").concat(key).concat("=").concat(val); } return qry; } }