likeIT likeIT - 1 year ago 111
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

Answer Source

You probably want

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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download