Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.LinkedList;

public class Main {
    public static LinkedList<Byte> toList(byte[] array) {
        LinkedList<Byte> resList = new LinkedList<Byte>();
        for (int i = 0; i < array.length; i++) {
            resList.add(array[i]);
        }
        return resList;
    }

    public static <T> LinkedList<T> toList(T[] array) {

        LinkedList<T> result = new LinkedList<T>();
        for (int i = 0; i < array.length; i++) {
            result.add(array[i]);
        }
        return result;
    }
}