sneezesnoeze
Gebruiker
- Lid geworden
- 3 feb 2008
- Berichten
- 41
http://www.codeguru.com/csharp/article.php/c19001/NET-Framework-Collections-and-Generics.htm
In bovenstaand artikel gaat het over generics en hoe handig dat wel niet is.
Als ik de voorbeeld code gebruik krijg ik de volgende foutmelding.
"Using the generic type "System.Collections.Generics.List<T>" requires 1 type argument".
Is er ooit een List geweest zonder type aanduiding ?
Is hier mogelijk de type aanduiding vergeten ?
In bovenstaand artikel gaat het over generics en hoe handig dat wel niet is.
Code:
List testGeneric = new List();
for (int i = 0; i < 20; i++)
{
// Go ahead and play here. You'll get a compile time error here
// if you try to add anything other than an int.
testGeneric.Add(i);
}
foreach (int item in testGeneric)
{
Console.Write("{0}", item);
}
Als ik de voorbeeld code gebruik krijg ik de volgende foutmelding.
"Using the generic type "System.Collections.Generics.List<T>" requires 1 type argument".
Is er ooit een List geweest zonder type aanduiding ?
Is hier mogelijk de type aanduiding vergeten ?