If you look up the word "parameters" in the dictionary, your brain will probably seize up. All it means is that the method has to be able to use the information you send it, so you simply have to specify the type of data that the method is allowed to use. That's it! It's very simple.
In the earlier screenshot, on line 23, we declared the firstNumber
and secondNumber
variables. The type is int
. Now notice our member variables: number1
, number2
, and number3
. They are also of the int
type. These variables have to be of the int
type since they store the numbers that will be added in the method, which the parameters specify will be of int
the type.
So now, go look in the dictionary again. You will probably see the word limit in there somewhere. That's what you did when you specified the type of data that the method will use, an integer in this case. You set some limits on what is allowed.
Okay, so you're setting parameters, or limits, on the type of data the method...