Skip to lesson

Must-do problems: Methods

These problems make you write your own methods, which is the habit every later topic builds on. Each task names the method to write: write it first, call it from main, and check your program against every test before opening a hint.

What you will learn

What you will learn

  • Split a problem into small static methods that each do one job
  • Choose the right parameters and return type, including long for big values
  • Use overloading where the same idea takes different inputs
  • Write recursive methods with a clear base case

Sign in to continue this lesson

Create an account to read every lesson, practise with the exercises and keep track of your progress.