Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.HashMap;

import java.util.List;
import java.util.Map;

public class Main {
    /**
     * Interim method to get this code to compile against the 1.0-RC1 engine.
     * Creats a map with only one key, and the list supplied as the collection of
     * values for that key.
     * @param key
     * @param list
     * @return
     */
    public static Map getMapFromList(Object key, List list) {
        HashMap map = new HashMap();
        for (Object value : list) {
            map.put(key, value);
        }
        return map;
    }
}