FIZZBUZZ Solution in Java 8

Here is the FizzBuzz Solution in java 8 with different methods, Here is the Before Java 8, simple solution: public static void main(String[] args){ for(int i= 1; i <= 20; i++){ if(i % 15 == 0){ System.out.println("FizzBuzz"); }else if(i % 3 == 0){ System.out.println("Fizz"); ...

Combine different list in to Set(single list) in Java 8 using Stream API

Combine the different list in to single list in java, there should be used in java 8 Creating a stream pipeline that transforms a list of sets (of type String) into the union of those sets. Make use of the reduce method for streams. Example: Orginal list [{“A”, “B”}, {“D”}, {“1”, “3”, “5”}] to the Final...

Print Square in Java Using Lambda or Stream API

Creates an IntStream using the iterate method. The method prints to the console the first num squares. For instance, if num = 4, then your method would output 1, 4, 9, 16. Note: You will need to come up with a function to be used in the second argument of iterate . public class Test { public static...