likeIT likeIT - 11 months ago 48
Java Question

defining static arrays in Java

hello I have some question about writing class in Java, why this one is not working:

public class EvenFibonacciSequences {

static final int num = 45;

static int calculated[num];

how can I write it correctly?
thanks in advance


You probably want

static int[] calculated = new int[num];

At least, I think that's right (have not dealt with Java in a while.)