Please enable JavaScript to use CodeHS

AP Computer Science A (Mocha)

Lesson 3.2 Methods and Parameters

Description

In this lesson, we continue to build our understanding of methods and introduced to parameters. Parameter are inputs to methods.

If methods are boxes, then parameters are inputs to our boxes (what goes inside the box).

Parameters allow us to generalize our methods so that they can solve more than one specific instance of a problem, and instead can solve different versions of the same problem (for example, add 10 to any given number).


Objective

Students will be able to…

  • Write general methods that take parameters as inputs.
  • Use parameters to generalize their methods to solve general problems.
  • Identify and fix improper parameter names in Java.