Yes, it sounds like a list inside a list, for example:
List<List<int>>
It wasn't nice to laugh at you though - it may indicate your code is better organized into logical classes. Such constructs, in general, should be avoided - you probably wouldn't want to expose or use an interface with too complicated types, but it is common to use such lists locally, specially when using LINQ.
A simple example where this can be useful would be:
string[] directories = Directory.GetDirectories("c:\\");
var files = directories.Select(Directory.GetFiles).ToList();
Here, files
is a List
holding an array of strings: List<string[]>
, which is quite similar. It is very likely your friends weren't talking about lists in particular, it is just as common you work with arrays, dictionaries, or IEnumerable
s.
The posted code does not have nested, or two dimensional lists. X has a array of Y, and that's it. If you has a list of Xs, however, that would have nested lists:
IEnumerable<X> xfiles = GetXFiles();
foreach(X file in xfiles)
{
foreach(Y section in file)
{
//...
}
}
It comes down to a simple point: an object can hold other objects, with any complexity.