Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.support.annotation.Nullable;

import java.util.List;

public class Main {
    public static <T> T getOrDefault(List<T> list, int position, @Nullable T defaultValue) {
        try {
            return list.get(position);
        } catch (Exception e) {
            return defaultValue;
        }
    }
}