How to initialize a Set using Eclipse Collections

Donald Raab
Sep 19, 2022

Initializing a Set using Eclipse Collections is simple and flexible.

Using the object and primitive Sets factory with method.

I answered the following question on Stack Overflow several years ago.

If you prefer of instead of with, the following will work just as well.

Using the object and primitive Sets factory of method.

If you’d like to understand why Eclipse Collections supports both of and with methods on factory classes, the following blog will help.

Thanks for reading! Enjoy!

I am the creator of and a Committer for the Eclipse Collections OSS project which is managed at the Eclipse Foundation. Eclipse Collections is open for contributions.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Donald Raab
Donald Raab

Written by Donald Raab

Java Champion. Creator of the Eclipse Collections OSS Java library (https://github.com/eclipse-collections). Inspired by Smalltalk. Opinions are my own.

No responses yet

Write a response