C
Chris
Hi,
the specs for System.Array are :
public abstract class Array : ICloneable, IList, ICollection,
IEnumerable
but I can't use any of the functions presented by IList in my code
System.Array numbers = new int[5]{1,2,5,6,7};
numbers.Add(1) --> NOT POSSIBLE Compiler error : 'System.Array' does
not contain a definition for 'Add'
Array.Add(2) --> NOT POSSIBLE Compiler error : 'System.Array'
does not contain a definition for 'Add'
nor some belonging to ICollection : SyncRoot:yes, Count:no
numbers.Count --> NOT POSSIBLE
IEnumerable : no problem
What is reasoning behind all this ?
Already does intelisense not show those functions. But why not ? if the
specs make you suppose you could use them.
I thought maybe 'cause the functions are abstract so you must implement them
yourself (such as IList::Add) but then again , IEnumerable:GetEnumerator()
is an abstract function as well and I can use that one, no problem.
Thanks in advance
Chris
the specs for System.Array are :
public abstract class Array : ICloneable, IList, ICollection,
IEnumerable
but I can't use any of the functions presented by IList in my code
System.Array numbers = new int[5]{1,2,5,6,7};
numbers.Add(1) --> NOT POSSIBLE Compiler error : 'System.Array' does
not contain a definition for 'Add'
Array.Add(2) --> NOT POSSIBLE Compiler error : 'System.Array'
does not contain a definition for 'Add'
nor some belonging to ICollection : SyncRoot:yes, Count:no
numbers.Count --> NOT POSSIBLE
IEnumerable : no problem
What is reasoning behind all this ?
Already does intelisense not show those functions. But why not ? if the
specs make you suppose you could use them.
I thought maybe 'cause the functions are abstract so you must implement them
yourself (such as IList::Add) but then again , IEnumerable:GetEnumerator()
is an abstract function as well and I can use that one, no problem.
Thanks in advance
Chris