I'm getting an error in Eclipse when trying to ini开发者_C百科tialize the following array in the initializing section of my class:
Color[] colors;
colors = new Color[4];
This is the error I'm getting:
Syntax error on token ";", , expected
Where ";" refers to the semicolon on the first line. Tried different variable types, gave the same error. Here's some code on the official JDK tutorial section that seems the same to me:
http://download.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
Thanks in advance, guys.
This is a correct syntax and does compile.
(Maybe the line before is a problem. Can you post it too)
精彩评论