title: What is the time complexity of declaring a 2d array
body: <p>What is the worst case running time of declaring a 2D array? The 2d array is not strictly square. I have seen answers that state it is O(n) and I have also seen answers that state its O(n²). </p>
  
  <p>In my mind, when declaring an object array such as this:</p>
  
  <pre><code>Object[][] gridArray = new Object[i][j];
  
  //The number of elements n = i*j
  </code></pre>
  
  <p>The time complexity when declaring the array should be O(n) as it will just scale linearly depending on how many elements there will be. Am I missing something?  </p>