1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Java

Connected

Exercise

Squaring

Working part-time 5 hours a day, 5 days a week, you often have to remember the square of 5. Rather than putting it everywhere in our code, let's develop a method to make it easier.

Instructions

100 XP
  • Give the proper type to return for the custom method.
  • Call that method, saving the result as hours.