title: Best way to "push" into C# array
body: <p>Good day all</p>
  
  <p>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 List, but that won't solve my issue.</p>
  
  <p>I teach a class in beginner C#. I have a PHP and Java Script background, and thus tend to think in terms of these languages. </p>
  
  <p>I have been looking for the best way to show my students how to add elements to an array on the fly.We can't use Lists, as these are not part of the syllabus that I currently teach (although they do come in later in the semester).</p>
  
  <p>I am thus looking for the simplest way to perform a Java array.push(newValue) type scenario that will be understandable to novice coders without teaching them bad practice.</p>
  
  <p>Here is how I have been approaching the problem so far:</p>
  
  <pre><code>for (int i = 0; i &lt; myArray.Length; i++)
  {
     if(myArray[i] == null)
     {
         myArray[i] = newValue;
         break;
     }
  }
  </code></pre>
  
  <p>I just need to know if this is an acceptable approach, if I am teaching them any bad practices, or if there is a better / simpler way of achieving my goal.</p>
  
  <p>EDIT
  The crux of the matter is that the element needs to be added into the first empty slot in an array, lie a Java push function would do.</p>
  
  <p>Any advice would be greatly appreciated.</p>