Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.List;

public class Main {
    public static <T> T getFirst(List<T> list) {
        T t = null;
        if (list != null && !list.isEmpty()) {
            t = list.get(0);
        }
        return t;
    }
}