了解方法参数及如何使用它们。
Identify the method parameters and understand how to use them.
使用值对象作为方法参数。
匿名对象可以通过方法参数发送。
不允许声明具有默认参数的方法参数。
It is not permitted to declare a method parameter with a default argument.
方法的参数。
调用该方法的参数转换函数。
可以看到,方法的参数可以是原生类型或是对象。
As you can also see, the method parameters can be primitive types or objects.
还要求开发人员记录每个方法的参数。
表1.open方法的参数。
设置Call对象的属性(方法名、参数等等)。
Set the properties of the Call object (method name, parameters, and so on).
这个方法取两个参数。
这个方法取三个参数。
例如,没有方法向信号添加参数。
设置第一个服务的目标URN、方法名和参数。
Set the target URN, method name, and parameters of the first service.
您也需要创建一个用到该模板参数的方法。
You will also need to create a method that USES the template parameter.
给Add方法传入多个参数也和C#非常类似。
Passing in multiple parameters to the Add method is also quite similar.
方法的返回类型在参数列表的最后出现。
如下所示,所使用方法的名称中没有参数。
方法或函数可通过传入参数与闭包通信。
A method or function can communicate with a closure by passing in arguments.
另外,将参数添加到方法中的界面是直观的。
In addition, the interface to add parameters to the method is intuitive.
程序传递要调用的远程方法的名称和所有必需参数。
Your program passes the name of the remote method to invoke and any necessary parameters.
请注意签名作为第一个参数如何传递到方法调用。
Note how the signature is passed as the first argument to the method call.
第一个方法还接受一个参数来作为分隔符。
The first method also takes an argument for the separator string.
每个方法有一个名字、若干参数和一个返回值。
Each method has a name, a number of parameters, and a return value.
该方法还有一个额外参数,类型为Customer。
This method also has one additional parameter of type Customer.
以前,这个方法接受Object数组作为它的参数。
Previously, the method accepted an Object array as its argument.
该方法的第一个参数是所提取模型的ID。
The first parameter of this method is the ID of the model to extract.
最后,accept方法接受第四个参数。
Finally, the accept method accepts a fourth argument not yet mentioned.
请注意前面的方法调用中两个参数都指定为 “english”。
Notice the specification of english as both parameters in the preceding method call.
应用推荐