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<T>
. 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");}