title: java-Declaring Array Based on If Statement
body: <p>I was wondering if there is any way to declare an array of different sizes depending on if an if statement condition is met. However, after typing in this code into NetBeans:</p>
  
  <pre><code>if(winner == true)
      double data[][] = new double[16][5];
  else
      double data[][] = new double[14][5];
  </code></pre>
  
  <p>I receive an error message stating: Variable declaration not allowed here.</p>
  
  <p>Why is this not allowed? Is there any way to accomplish what I am trying to do?
  Tia.</p>
  
  <p><strong>NOTE</strong></p>
  
  <p>As was made clear in the answers provided, I was not considering scope when writing this post. I apologize. Thanks to everyone who provided helpful solutions and insight. </p>