1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Java

Connected

Exercise

Increment by one

Increasing or decreasing a value by one is so common in programming that Java provides special operators just for this purpose. These shortcuts make your code cleaner and more efficient. Let's practice counting up and down!

Instructions

100 XP
  • Increase age by one using the increment operator.
  • Decrease days by one using the decrement operator.