← Back to context

Comment by 1718627440

4 months ago

Can you have a collection of primitives?

No, but yes. There is nothing in the standard library, that implements the Collection-interface and works with primitives. However you can write your own and there are several implementations of collections for primitives. The problem is that you have to implement them seperately for each type of primitive (e.g. an IntList, DoubleList, BooleanList...).