2.7. Clickable CodeΒΆ

The clickable code feature allows the student to click on particular lines of code and check if they have clicked on the correct lines. It can be useful for helping students identify particular parts of code. It works with any text.

The following example is from the Java Review ebook. You can see it by clicking on the following link Click-Variable.

2-3-1: Click on all of the variable declarations in the following code.Variable declarations start with a type and then a name.
public class Test2
{
    public static void main(String[] args)
    {
        int numLives;
        numLives = 0;
        System.out.println(numLives);
        double health;
        health = 8.5;
        System.out.println(health);
        boolean powerUp;
        powerUp = true;
        System.out.println(powerUp);
    }
}

You can also use clickable code to identify particular indices in an array.

The following example is from the Java Review ebook. You can see it by clicking on the following link Click-Array.

2-3-2: Click on the values at index 0 and 2 in the following array.Remember that the first value is at index 0. Click on an area again to unselect it and try again.

4

-2

8

7

Next Section - 2.8. Fill in the Blank