title: Different ways of declaring arrays in VB.NET
body: <p>In VB.NET, is there any difference between the following ways of declaring arrays?</p>
  
  <pre><code>- Dim cargoWeights(10) as Double
  
  - cargoWeights = New Double(10) {}
  </code></pre>
  
  <p>' These are two independent statements. They are not supposed to execute one after the other.</p>
  
  <p>As far as I know, the first one just declares an array variable that holds the value 'Nothing' until some array object is assigned to it. In other words, it is not initialized yet.</p>
  
  <p>But what about the second statement? Does the "=" sign means the variable is already being initialized and won't hold 'Nothing'? Is it going to point to an one-dimensional array of eleven default Double values (0.0)?</p>
  
  <p>EDIT:</p>
  
  <p>According to MSDN website:</p>
  
  <blockquote>
    <p>The following example declares an array variable that does not initially point to any array.</p>
    
    <p>Dim twoDimStrings( , ) As String</p>
    
    <p>(...) the variable twoDimStrings has the value Nothing.</p>
  </blockquote>
  
  <p>Source: <a href="http://msdn.microsoft.com/en-us/library/18e9wyy0(v=vs.80).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/18e9wyy0(v=vs.80).aspx</a></p>