...

/

Constituents

Constituents

Learn about what constitutes method!

What makes a method?

There are four things that constitute a method:

  • a name
  • a block of code
  • (optionally) accepting input
  • returning output

Not all methods actually need input (so they don’t take any), and not always do we care about the output that a method returns.

Example

Imagine a vending ...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy