Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Collections;

import java.util.List;

public class Main {
    public static <V> List<V> subList(List<V> list, int startIndex, int count) {
        if (null == list || startIndex >= list.size() || count <= 0) {
            return Collections.emptyList();
        }
        int endIndex = Math.min(startIndex + count, list.size());
        return list.subList(startIndex, endIndex);
    }
}