Good day all
So I know that this is a fairly widely discussed issue, but I can\'t seem to find a definitive answer. I know that you can do what I am asking for using a L
The is no array.push(newValue)
in C#. You don't push to an Array in C#. What we use for this is a List
. What you may want to consider (for teaching purpose only) is the ArrayList (no generic and it is a IList, so ...).
static void Main()
{
// Create an ArrayList and add 3 elements.
ArrayList list = new ArrayList();
list.Add("One"); // Add is your push
list.Add("Two");
list.Add("Three");
}