My goal is to create a imperative program in C# and I know how to go about just using a for loop or while loop etc. But I was told they way I'm using my data/getting the data which is not imperative? I want to have something like a list of lists? and doing so this way:
static void Main()
{
List<string> list1 = new List<string> {"asd","asfasf","asfasf"};
List<string> list2 = new List<string> {"asd","asfasf","asfasf"};
List<string> list3 = new List<string> {"asd","asfasf","asfasf"};
List<string> list4 = new List<string> {"asd","asfasf","asfasf"};
List<string> list5 = new List<string> {"asd","asfasf","asfasf"};
List<List<string>> lists = new List<List<string>> {list1,list2,list3,list4,list5};
}
I am not sure if this is an imperative approach to doing so or not? I had this before which i know is basically the exact same:
static void Main()
{
List<List<string>> lists = new List<List<string>>();
lists.Add(new List<string> {"asd","asfasf","asfasf"});
}
But was told it wasn't as it was using parametric polymorphism which is OOP. I was told for likes of python and that that we couldn't use Lists unless we write our own list declaration and functioned. We also couldn't use built-in functions(e.g .split())