Java List First Item getFirstElement(List list)

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

Description

get First Element

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {

    public static <T> T getFirstElement(List<T> list) {
        if (list != null && list.size() >= 1) {
            return list.get(0);
        }/*from ww  w .j ava  2 s . c  o m*/
        return null;
    }
}

Related

  1. getFirstColumn(List> llo, String reason)
  2. getFirstDuplicateValue(List values)
  3. getFirstElement(List list)
  4. getFirstElement(List collection)
  5. getFirstElement(List list)
  6. getFirstElementFromList(List list)
  7. getFirstFromList(List list)
  8. getFirstInstanceOf(List source, String className)
  9. getFirstItemOrNull(List items)