Streams Set Distinct Java Challenge

streams set

Using streams, and Set Collection Factory methods with Java make code easier to read and maintain. By using those features we can also make it more difficult for bugs to hide. If you can use the latest LTS (Long-term support) Java version in your project, it’s the best scenario so that you can use cool Java features such as Collection Factories from Java 9!

Now that we know why it’s important to understand Java features well, it’s time for the Java Challenge!

It's time to improve your Java skills with this Stream Set Distinct Challenge

Stream Set Distinct Challenge

Can you guess what will happen when running the following Java code?


stream distinct challenge

If you want to watch the video explanation, check it out (But I recommend trying out the Java Challenge first):

That’s it challenger, rock on! Keep taking action and relentlessly break your limits! Don’t hesitate to leave a comment with a question if anything is not clear!

Written by
Rafael del Nero
Join the discussion