Here you can find the source of first(List
Parameter | Description |
---|---|
l | the list the first element is to be extracted from. |
public static <T> T first(List<T> l)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**//from ww w. ja v a 2 s .c o m * Get the first element from a list. * * @param l * the list the first element is to be extracted from. * @return the first element of the passed in list. */ public static <T> T first(List<T> l) { return l.get(0); } }