Jun-25-2020, 10:53 AM
(This post was last modified: Jun-25-2020, 10:54 AM by Gribouillis.)
frank0903 Wrote:how to define homougeneous collections? I mean how to express it more exactlyThere is no general definition. Often it means that the objects are all instances of the same class. It really depends on what you want to do with the objects. For example if you want to be able to add an integer to each object, then it could be a definition of homogeneous collection: "a list of objects to which one can add an integer".
There is no side effect whatsoever, the list class doesn't care about the kind of objects that it contains. The only effect is that the code that uses this list will be simpler if it doesn't have to worry about the type of the objects.