Passing Arguments

In this lesson, we look at the different ways to pass an argument to a method.

Parameters of a primitive type

When a formal parameter has a primitive type such as int, it is initialized to the value of the corresponding argument in the call to the method. This argument can be a literal constant—such as 51—or it can be a variable or any ...