If you have a custom collection class that stores the weights of a single class of fruits individually in floats/double, like so:
1.1, 3.3, 6.6, 4.4, ...
and you would need to specify whether it's float or double and to differentiate the fruit type, is it better to do it like this:
Using an enum:
FruitList<float, FruitType.Orange>
or
Using an enum in the constructor:
FruitList<float> (FruitType.Orange)
or
Using a class:
FruitList<float, Orange>
or
Using a class in the constructor:
FruitList<float> (Orange)
Thing thing that confuses me is whether specifying these kind of stuff makes sense in the <> area (don't know what that area is called)?
Which is the better, faster, more efficient practice?
Btw the Orange class is never used anywhere, just wrote it if that would make sense to specify the type like that?
EDIT: Btw this is just an example case, not the actual one, but this reflects in a clear way. Like it's all floats/doubles and are passed to some other methods. But the methods need to know what type of fruit to perform correctly. The fruit themselves mean nothing.