parameters arguments 形式参数 实际参数
parameter和argument的区别 – 笑遍世界 http://smilejay.com/2011/11/parameter_argument/
https://en.wikipedia.org/wiki/Parameter_%28computer_programming%29
For example, if one defines the add subroutine as def add(x, y): return x + y, then x, y are parameters, while if this is called as add(2, 3), then 2, 3 are the arguments.
In computer programming, a parameter (often called formal parameter[1] or formal argument) is a special kind of variable, used in a subroutine to refer to one of the pieces of data provided as input to the subroutine.[a]These pieces of data are the values[2][3][4] of the arguments (often called actual arguments or actual parameters) with which the subroutine is going to be called/invoked. An ordered list of parameters is usually included in the definition of a subroutine, so that, each time the subroutine is called, its arguments for that call are evaluated, and the resulting values can be assigned to the corresponding parameters.
Unlike argument in usual mathematical usage, the argument in computer science is thus the actual input expression passed/supplied to a function, procedure, or routine in the invokation/call statement, whereas the parameter is the variable inside the implementation of the subroutine. For example, if one defines the add subroutine as def add(x, y): return x + y, then x, y are parameters, while if this is called as add(2, 3), then 2, 3 are the arguments. Note that variables (and expressions thereof) from the calling context can be arguments: if the subroutine is called as a = 2; b = 3; add(a, b) then the variables a, b are the arguments, not the values 2, 3. See the Parameters and arguments section for more information.
In the most common case, call by value, a parameter acts within the subroutine as a new local variable initialized to the value of the argument (a local (isolated) copy of the argument if the argument is a variable), but in other cases, e.g. call by reference, the argument variable supplied by the caller can be affected by actions within the called subroutine (as discussed in evaluation strategy).
The semantics for how parameters can be declared and how the (value of) arguments are passed to the parameters of subroutines are defined by the language, but the details of how this is represented in any particular computer system depend on the calling conventions of that system.
Generic Types (The Java™ Tutorials > Learning the Java Language > Generics (Updated)) https://docs.oracle.com/javase/tutorial/java/generics/types.html
Type Parameter and Type Argument Terminology: Many developers use the terms "type parameter" and "type argument" interchangeably, but these terms are not the same. When coding, one provides type arguments in order to create a parameterized type. Therefore, the T in Foo<T> is a type parameter and the String in Foo<String> f is a type argument. This lesson observes this definition when using these terms.
parameters arguments 形式参数 实际参数的更多相关文章
- 1.7.4.2 Local Parameters in Queries--局部参数
1. 局部参数 Local parameters是在solr请求中指定一个查询参数.Local parameters提供了一个方式以添加元数据到某个参数类型中,如查询字符串(在solr文档中,Loca ...
- arguments对象----不定参数的实现方式
function format(string) { var args = arguments; var pattern = new RegExp("%([1-" + argumen ...
- C#编程:SqlCommand.Parameters.Add()方法的参数问题。
在存储过程中添加2个参数 sql语句 例: “update [tablename] username = @username where id=@id” 然后把需要的 command.Paramete ...
- [Effective JavaScript 笔记]第22条:使用arguments创建可变参数的函数
第21条讲述使用可变参数的函数average.该函数可处理任意数量的参数并返回这些参数的平均值. 如何创建可变参数的函数 1.实现固定元数的函数 书上的版本 function averageOfArr ...
- JavaScript Arguments 实现可变参数的函数,以及函数的递归调用
//可变参数的函数 注:也可以使用对象作为参数来实现 function Max() { var temp = arguments[0] || 0; for (var i = 1; i < arg ...
- Parameter index out of range(1 > number of parameters, which is 0)参数索引超出范围
今天在写项目的过程中,有一个模块是做多选删除操作,通过servlet获得多选框的value组,然后执行sql操作.如下: 1 @RequestMapping( "/delteCouse.do ...
- ES6函数剩余参数(Rest Parameters)
我们知道JS函数内部有个arguments对象,可以拿到全部实参.现在ES6给我们带来了一个新的对象,可以拿到除开始参数外的参数,即剩余参数(废话好多 O(∩_∩)O~). 这个新的对象和argume ...
- 宏参数(Arguments)的扩展
宏分为两种,一种是 object-like 宏,比如: #define STR "Hello, World!" 另一种是 function-like 宏,比如: #define M ...
- JS函数arguments数组获得实际传参数个数
JS与PHP在函数传参方面有点不同,PHP形参与实参个数要匹配,而JS就灵活多了,可以随意传参,实参比形参少或多都不会报错. 实参比形参多不会报错 ? 1 2 3 4 5 function say(a ...
随机推荐
- UML系列,使用UML实现GOF Design patterns,常用模式类图解读
1.单例:Singleton, DirectedAssociation
- AC日记——线段树练习4 codevs 4919
4919 线段树练习4 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 题目描述 Description 给你N个数,有两种操作 ...
- git-版本管理工具的介绍+发展史+分布式版本控制系统和集中式版本控制系统的区别
一.版本管理工具的介绍: 1.备份文件: 2.记录历史: 3.多端共享: 4.团队协作: 二.版本管理工具的发展史: 1.cvs: 集中式 1985: 2.svn: 集中式 2000: 3 ...
- bzoj 4921: [Lydsy六月月赛]互质序列
4921: [Lydsy六月月赛]互质序列 Time Limit: 1 Sec Memory Limit: 256 MBSubmit: 188 Solved: 110[Submit][Status ...
- 一道简单DP题
问题: 给定一个整数的数组,相邻的数不能同时选,求从该数组选取若干整数,使得他们的和最大,要求只能使用o(1)的空间复杂度.要求给出伪码. 解答: int maxSum(vector<int&g ...
- 【java】深入分析Java ClassLoader原理
一.什么是ClassLoader? 大家都知道,当我们写好一个Java程序之后,不是管是CS还是BS应用,都是由若干个.class文件组织而成的一个完整的Java应用程序,当程序在运行时,即会调用该程 ...
- WM_SETFOCUS和WM_KILLFOCUS、WM_GETDLGCODE
procedure WMSetFocus (var Message: TWMSetFocus); message WM_SETFOCUS; //获得焦点 procedure WMKillFocus ...
- elasticsearch 查询模板
简单版示例: 2.x版本(相比于1.x版本,使用bool替代filtered,使用must替代query) { "query": { "bool": { &qu ...
- maven编译maven-surefire-plugin插件报错
1.编译错误信息: [INFO] ------------------------------------------------------------------------ [ERROR] Fa ...
- LeetCode 第 3 题(Longest Substring Without Repeating Characters)
LeetCode 第 3 题(Longest Substring Without Repeating Characters) Given a string, find the length of th ...