title: Create a new instance of a type given as parameter
body: <p>I've searched for an answer and found some c#-examples, but could not get this running in vb.net:</p>
  
  <p>I thought of something like the following:</p>
  
  <pre><code>public function f(ByVal t as System.Type)
    dim obj as t
    dim a(2) as t
  
    obj = new t
    obj.someProperty = 1
    a(0) = obj
  
    obj = new t
    obj.someProperty = 2
    a(1) = obj
  
    return a
  End Function
  </code></pre>
  
  <p>I know, I can create a new instance with the Activator.Create... methods, but how to create an array of this type or just declare a new variable? (dim)</p>
  
  <p>Thanks in advance!</p>