Here you can find the source of tail(List
Parameter | Description |
---|---|
list | a parameter |
public static <T> List<T> tail(List<T> list)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Collections; import java.util.List; public class Main { /**/*from w w w .j av a 2 s.c o m*/ * Returns a sublist containing all the items in the list after the first * * @param list * * @return */ public static <T> List<T> tail(List<T> list) { if (list.isEmpty()) return Collections.emptyList(); else return list.subList(1, list.size()); } public static <T> int size(final T[] items) { return items.length; } public static <T> int size(final Collection<T> items) { return items.size(); } }