It is syntactically correct (because a
Add
method accepts an
object
and an
ArrayList
, the return value of
GetRange
, is an
object
) but probably is NOT what you want to do, try instead:
player1.Add(cards[card]));
This 'ambiguity' is a
strong point in favour of
strong typed collections ( :-) ), that is generic collections.