Java List Tail tail(final List list)

Here you can find the source of tail(final List list)

Description

tail

License

Open Source License

Declaration

public static <T> List<T> tail(final List<T> list) 

Method Source Code


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

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static <T> List<T> tail(final List<T> list) {
        return drop(list, 1);
    }/*w  ww .j av a 2 s .  co  m*/

    public static <T> List<T> drop(final List<T> list, final int count) {
        List<T> left = new ArrayList<>();
        int lastIndex = count;
        while (lastIndex < list.size()) {
            left.add(list.get(lastIndex));
            lastIndex++;
        }
        return left;
    }
}

Related

  1. tail(List list)
  2. tail(List list, int tailLength)
  3. tail(List lines, int number)
  4. tail(List lst, int from)