If I have a 2+ list of int numbers, can I save these lists inside another list to pass it to another class or method? I want to have access to each list individually, but I want to be able to transfer them all together in one batch. What will be the syntax of this, as well as what will be the correct method of accessing each list in the main list. For example, I have these separate lists:
List<int> Nums1= new List<int>(new int[] { 6, 76, 5, 5, 6 }); List<int> Nums2= new List<int>(new int[] { 6, 4, 7, 5, 9 }); List<int> Nums3= new List<int>(new int[] { 22, 11, 5, 4, 6 });
Then I want to save them in another list in order to go to the method, for example:
static public List<int> DoSomething (List<int> Allnums) {
Then I want to save them back to the main list and return them to my main list.
source share