title: Method to increment array parameter without types
body: <p>I'm trying to create a method to perform both increment and value assignment operations, something like this:</p>
  <pre><code>Public Sub ArrayAdd(ByRef arr As Object(), newItem As Object)
          Try
              If IsNothing(arr) Then
                  arr = New Object() {newItem}
                  Exit Sub
              End If
              Array.Resize(arr, arr.Length + 1)
              arr(arr.Length - 1) = newItem
          Catch ex As Exception
              Throw New ApplicationException(ex.Message, ex)
          End Try
      End Sub`
  </code></pre>
  <p>Using this method generates type conversion errors, so I would like to use generics <code>Of T</code> (without success).</p>