Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;
import java.util.Collection;

public class Main {
    public final static <T> T getLast(ArrayList<T> list) {
        if (list != null && list.size() > 0) {
            return list.get(list.size() - 1);
        }
        return null;
    }

    public final static int size(Collection c) {
        return c == null ? 0 : c.size();
    }
}