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.Iterator;
import java.util.List;

public class Main {
    public static <T> List<T> listFromIterator(Iterator<T> i) {
        List<T> retval = new ArrayList<T>();
        while (i.hasNext())
            retval.add(i.next());
        return retval;
    }
}