Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Map;

public class Main {
    public static String getParams(Map<String, String> form) {
        StringBuffer params = new StringBuffer();
        int i = 0;
        for (Map.Entry<String, String> entry : form.entrySet()) {
            if (i > 0) {
                params.append("&");
            }
            params.append(entry.getKey());
            params.append("=");
            params.append(entry.getValue());
            i++;
        }
        return params.toString();

    }
}