C# ArrayList question.
Why does it''s Clone() method return an object, instead of an ArrayList? All it does is force me to cast to an ArrayList whenever I use Clone().
ArrayList.Clone() is an implementation of the ICloneable interface. And ICloneable.Clone() is defined to return an Object type.
edit: and C# doesn't support covariant return types.
[edited by - SiCrane on May 20, 2004 9:35:28 PM]
edit: and C# doesn't support covariant return types.
[edited by - SiCrane on May 20, 2004 9:35:28 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement