Java List First Item first(List list)

Here you can find the source of first(List list)

Description

first

License

Open Source License

Declaration

public static <T> T first(List<T> list) 

Method Source Code


//package com.java2s;
import java.util.*;

public class Main {
    public static <T> T first(List<T> list) {
        if (list == null || list.isEmpty())
            throw new IllegalArgumentException("List is empty");
        return list.get(0);
    }/*w ww .  ja  va  2s .co m*/
}

Related

  1. first(List list)
  2. first(List list)
  3. first(List list)
  4. first(List list)
  5. first(List list)
  6. first(List list)
  7. first_nItems(int n, Collection fromList)
  8. firstBoolean(List list)
  9. firstColumnRemovable(List data)