← Unit 1 · all exercises
Saved in this browser only

Label a value

Print the label, then a colon, then a space, then the number. For the label "Score" and the number 42, print exactly: Score: 42

void label(String name, int value)

Solution.java
Loading editor…
Results

Examples

  • label(Score, 42) → Score: 42
  • label(Lives, 3) → Lives: 3

There are also 3 hidden tests you can't see. Solve the problem, not the examples.