Aggregating Maps with Streams

Write a method

static <T> Stream<T> zip(Stream<T> first, 
            Stream<T> second);

that alternates elements from the streams first and second, stopping
when one of them runs out of elements.

Advertisements

Lambdas in Java 8

Todays Quiz :

Write a function which returns all the files with a particular extension in a given directory.

Implement the following method and print them.

List<File> printAllFiles(String filePath,
               String extension);

Continue reading “Lambdas in Java 8”