Java List First Item first(List list)

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

Description

first

License

Apache License

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {

    public static <T> T first(List<T> list) {
        return isEmpty(list) ? null : list.get(0);
    }/*from  w  w w. j ava 2  s  .  co m*/

    public static boolean isEmpty(String content) {
        return content == null || content.isEmpty();
    }

    public static <T> boolean isEmpty(List<T> list) {
        return list == null || list.isEmpty();
    }
}

Related

  1. first(List list)
  2. first(List l)
  3. first(List l)
  4. first(List list)
  5. first(List list)
  6. first(List list)
  7. first(List list)
  8. first(List list)
  9. first(List list)