I've written the following code:
for(int layer = 0; layer <countLayers; layer++);
{
List<Sprite> spritesInLayer = sceneGraph.getLayer(layer);
}
when i compile this snippet, I get an error, that in the line within the for-Loop, eclipse complains that 'layer' is an unknown symbol [... = sceneGraph.getLayer(layer);] and wants me to introduce the field / variable / ... 'layer'.
But when using this snippet, it works.
int layer = 0;
for(layer = 0; layer <countLayers; layer++);
{
List<Sprite> spritesInLayer = sceneGraph.getLayer(layer);
}
does anybody know, what I'm missing in the first code? Or might this be some kind of a bug of eclipse / the java compiler?
I'm using Java 6 JDK Update 20 64 bit on Win 7 64-bit Home Premium and Eclipse Helios 64-bit (build 20100617-1415)