×

java · level 1 · unit 2 · lesson 3

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

Give every box a name that tells you what is inside.

Names can use letters, digits and _. They cannot have spaces and cannot start with a digit. Capitals matter, so score and Score are two different boxes.

Some words are taken. A such as int, class or public already means something to Java, so it cannot be a name.

For names made of several words, Java coders use : squash the words together and give each new word a capital, like favouriteFood. Pick names that say what is inside.

public class Main {
    public static void main(String[] args) {
        String favouriteFood = "pizza";
        int bestScore = 120;
        System.out.println(favouriteFood);
        System.out.println(bestScore);
    }
}

A name like x works, but bestScore tells future you what it means.