Here you can find the source of getFirst(Collection c)
Parameter | Description |
---|
public static Object getFirst(Collection c)
//package com.java2s; import java.util.Collection; public class Main { /**/* w w w . j a v a2 s.c om*/ * Returns the first element in a collection (according to its iterator). * * @throws java.util.NoSuchElementException * if collection is empty. */ public static Object getFirst(Collection c) { return c.iterator().next(); } }