Reputation: 307
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
Upvotes: 0
Views: 203
Reputation: 240
You can't declare an array with an array size.It is illegal. Instead, you should do it (specifying the array size) during array initialization as @likeIT has given.
Upvotes: 0
Reputation: 3213
You probably want
static int[] calculated = new int[num];
At least, I think that's right (have not dealt with Java in a while.)
Upvotes: 5