This site requires JavaScript, please enable it in your browser!
Greenfoot back
Plop
Plop wrote ...

2018/11/2

What does it mean when the Brackets are surrounding the i? What does the do for the constructor class?

Plop Plop

2018/11/2

#
 public static void initializeImages() 
    {
        if(images == null) 
        {
            GreenfootImage baseImage = new GreenfootImage("wave.png");
            images = new GreenfootImage[NUMBER_IMAGES];
            int i = 0;
            while (i < NUMBER_IMAGES) 
            {
                int size = (i+1) * ( baseImage.getWidth() / NUMBER_IMAGES );
                images[i] = new GreenfootImage(baseImage);
                images[i].scale(size, size);
                i++;
            }
        }
    }
danpost danpost

2018/11/2

#
What does it mean when the Brackets are surrounding the i? What does the do for the constructor class?
Please refer to this page of the Java tutorials.
You need to login to post a reply.