Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Collection;

import java.util.List;

public class Main {

    public static <T> T getFirstElement(List<T> liste) {
        if (isEmpty(liste)) {
            return null;
        } else {
            return liste.get(0);
        }
    }

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