Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.LinkedHashMap;

public class Main {

    public static <T> LinkedHashMap<String, T> arraryToLinkedHashMap(T[] itemsArray) {
        LinkedHashMap<String, T> map = new LinkedHashMap<String, T>();
        T[] arrayOfObject = itemsArray;
        int j = itemsArray.length;
        for (int i = 0; i < j; i++) {
            T s = arrayOfObject[i];
            map.put(s.toString(), s);
        }
        return map;
    }
}