How do I make a constructor to set the length of a global array?
I have already tried several ways to do it, none successful.
Example:
public Class{
public Class(int length){
double[] array = new double[length]; <- this is not global
L = length;
}
int L;
double[] array = new double[L]; <- this does not work
}
I need an array with a length determined by Constructor.
double[] array
outside of the constructor and then creating the objectarray = new double[length];
inside the constructor? – hax0r_n_code Jul 8 '13 at 14:33