Comment by krior
4 months ago
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...).
Can't you use templates for that, or do these also only work with objects?
Templates do not exist in Java.
My bad, I think they are called Generics in Java. I always thought of these as the same thing, just with different names in different languages, is that wrong?
3 replies →