concept method parameter in category java

This is an excerpt from Manning's book Java SE 11 Programmer I Certification Guide.
It’s valid to define the method parameter passed to the main method as a variable argument (varargs) of type String:
Figure 8.2 shows the code of a method accepting method parameters and defining a return type and a return statement.
Figure 8.2 An example of a method that accepts method parameters and defines a return type and a return statement
![]()
Method parameters are the variables that appear in the definition of a method and specify the type and number of values that a method can accept (except for varargs, of course). In figure 8.3, the variables phNum and msg are the method parameters.
Figure 8.3 An example of a method that accepts method parameters and defines a return type and a return statement
![]()
You can pass multiple values to a method as input. Theoretically, no limit exists on the number of method parameters that can be defined by a method, but practically it’s not a good idea to define more than three method parameters. It’s cumbersome to use a method with too many method parameters because you have to cross-check their types and purposes multiple times to ensure that you’re passing the right values at the right positions.
Note Although the terms method parameters and method arguments are not the same, you may have noticed that many programmers use them interchangeably. Method parameters are the variables that appear in the definition of a method. Method arguments are the actual values that are passed to a method while executing it. In figure 8.3, the variables phNum and msg are method parameters. If you execute this method as sendMsg("123456", "Hello"), then the String values "123456" and "Hello" are method arguments. As you know, you can pass literal values or variables to a method. Thus, method arguments can be literal values or variables.

This is an excerpt from Manning's book OCA Java SE 8 Programmer I Certification Guide.
Purpose: This exercise encourages you to execute the code in the options to understand the correct method signature of the method main together with the method parameters that are passed to it.
It isn’t compulsory to define all attributes of a class before defining its methods (the variable weight is defined after Phone’s constructor). But this is far from being optimal for readability.
Figure 3.4. Comparison of the scope of method parameters and local variables
![]()

This is an excerpt from Manning's book The Well-Grounded Java Developer.
It may have restricted usage if annotated with @Target; for example, it might restrict usage to fields as opposed to the default of fields and method parameters.
Parentheses for method parameters