Cralis <ad***@myschoolmates.comwrote:
Could you point out a simple example if this being done? Seems like a
good idea. So you're creating a class, 'User', and a list of these
users, then returning this list? What help can I look out for with
regards this List?
Look up List<Tin MSDN. It's the generic version of ArrayList. As an
example, with a suitable User class, you could do:
List<UserGetUsers()
{
List<Userret = new List<User>();
ret.Add (new User("Jon", 1));
ret.Add (new User("Douglas", 2));
return ret;
}
foreach (User user in GetUsers())
{
Console.WriteLine (user.Name);
}
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too