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:
if(winner == true)
double data[][] = new double[16][5];
else
double data[][] = new double[14][5];
I receive an error message stating: Variable declaration not allowed here.
Why is this not allowed? Is there any way to accomplish what I am trying to do? Tia.
NOTE
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.
double data[][] = new double[winner? 16 : 14][5];