Chances are your methods aren't always going to be as simple as GenerateCharacter(). To pass in additional information, we'll need to define parameters that our method can accept and work with. Every method parameter is an instruction and needs to have two things:
- An explicit type
- A unique name
Does this sound familiar? Method parameters are essentially stripped-down variable declarations and perform the same function. Each parameter acts like a local variable, only accessible inside their specific method.
You can have as many parameters as you need. Whether you're writing custom methods or using built-in ones, the parameters that are defined are what the method requires to perform its specified task.
If parameters are the blueprint for the types of values a method can accept, then arguments are the values themselves. To break this down further, consider the following:
- The argument that's passed into a method needs to match the parameter type...