Here the definition of the skip method of Stream :
skip(long n) Returns a stream consisting of the remaining elements of this stream after discarding the first n elements of the stream.
My question is why the parameter is long instead of int ?
Here an example :
import java.util.Arrays;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<String> stringList = Arrays.asList("1","1","2","3","4");
stringList.stream()
.skip(2)
.forEach(System.out::print);// will prints 234
}
}