Hello, when learning about generics lists, found exception (The modifier 'public' is not valid for this item) in a code, showed on Page 237, and don't know is it correct in a book or not.
In Errata I didn't found about this.
Sinceresly, Vladimir.
PS, your book is great!
List<string> words = Repeat<string>("Alright", 3);
List<int> zeroes = Repeat<int>(0, 100);
public static List<T> Repeat<T>(T value, int times)
{
List<T> collection = new List<T>();
for (int index = 0; index < times; index++)
collection.Add(value);
return collection;
}
Hello, when learning about generics lists, found exception (The modifier 'public' is not valid for this item) in a code, showed on Page 237, and don't know is it correct in a book or not.
In Errata I didn't found about this. Sinceresly, Vladimir.
PS, your book is great!