Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;

import java.util.HashMap;

import java.util.Iterator;

import java.util.Map;
import java.util.Set;

public class Main {
    public static ArrayList<String> getHashMap(HashMap<String, String> hm) {
        ArrayList<String> a = new ArrayList<String>();
        Set s = hm.entrySet();
        Iterator it = s.iterator();
        while (it.hasNext()) {
            Map.Entry m = (Map.Entry) it.next();
            a.add(m.getKey() + "\t" + m.getValue());
        }
        return a;
    }
}