参数列表中引用变量占位符的术语
Term for the reference variable placeholder in a parameter list
方法的参数列表中引用变量占位符的正确术语是什么?
public static void SomeMethod(objectType ???referenceVariablePlaceholder???)
我将其称为参数名称,除非我误解了问题...
编辑:为了更好地解释这一点,根据您的评论,在以下代码中:
public void method(int a)...
我会说 a
是方法 method
的参数列表中第一个(也是唯一一个)参数的参数名称。
如果有人调用它:
method(2)
我将调用 2
参数,它是在 method
中的参数 a
上设置的。
如果有人调用它:
int b = 2
method(b)
我会说b
是参数名,参数的值为2。
中都调用了参数
The method definition specifies the names and types of any parameters
that are required. When calling code calls the method, it provides
concrete values called arguments for each parameter. The arguments
must be compatible with the parameter type but the argument name (if
any) used in the calling code does not have to be the same as the
parameter named defined in the method
The parameter list in parenthesis—a comma-delimited list of input
parameters, preceded by their data types, enclosed by parentheses, ().
If there are no parameters, you must use empty parentheses.
它被称为"formal parameter"。
函数的调用中使用的参数称为"actual parameter"。
方法的参数列表中引用变量占位符的正确术语是什么?
public static void SomeMethod(objectType ???referenceVariablePlaceholder???)
我将其称为参数名称,除非我误解了问题...
编辑:为了更好地解释这一点,根据您的评论,在以下代码中:
public void method(int a)...
我会说 a
是方法 method
的参数列表中第一个(也是唯一一个)参数的参数名称。
如果有人调用它:
method(2)
我将调用 2
参数,它是在 method
中的参数 a
上设置的。
如果有人调用它:
int b = 2
method(b)
我会说b
是参数名,参数的值为2。
The method definition specifies the names and types of any parameters that are required. When calling code calls the method, it provides concrete values called arguments for each parameter. The arguments must be compatible with the parameter type but the argument name (if any) used in the calling code does not have to be the same as the parameter named defined in the method
The parameter list in parenthesis—a comma-delimited list of input parameters, preceded by their data types, enclosed by parentheses, (). If there are no parameters, you must use empty parentheses.
它被称为"formal parameter"。
函数的调用中使用的参数称为"actual parameter"。