Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Iterator;

public class Main {
    public static <T> T nth(Iterable<T> coll, int which) {
        Iterator<T> it = coll.iterator();
        T ret = null;
        while (which-- >= 0)
            ret = it.next();
        return ret;
    }
}