get First Element Of Iterable - Java java.util

Java examples for java.util:Iterable Element

Description

get First Element Of Iterable

Demo Code


//package com.java2s;

public class Main {
    public static <T> T getFirstElementOf(Iterable<T> iterable) {
        return iterable.iterator().next();
    }/*  w  w  w.java2 s.  c om*/
}

Related Tutorials