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. 1.7.4.2 Local Parameters in Queries--局部参数

    1. 局部参数 Local parameters是在solr请求中指定一个查询参数.Local parameters提供了一个方式以添加元数据到某个参数类型中,如查询字符串(在solr文档中,Loca ...

  2. arguments对象----不定参数的实现方式

    function format(string) { var args = arguments; var pattern = new RegExp("%([1-" + argumen ...

  3. C#编程:SqlCommand.Parameters.Add()方法的参数问题。

    在存储过程中添加2个参数 sql语句 例: “update [tablename] username = @username where id=@id” 然后把需要的 command.Paramete ...

  4. [Effective JavaScript 笔记]第22条:使用arguments创建可变参数的函数

    第21条讲述使用可变参数的函数average.该函数可处理任意数量的参数并返回这些参数的平均值. 如何创建可变参数的函数 1.实现固定元数的函数 书上的版本 function averageOfArr ...

  5. JavaScript Arguments 实现可变参数的函数,以及函数的递归调用

    //可变参数的函数 注:也可以使用对象作为参数来实现 function Max() { var temp = arguments[0] || 0; for (var i = 1; i < arg ...

  6. Parameter index out of range(1 > number of parameters, which is 0)参数索引超出范围

    今天在写项目的过程中,有一个模块是做多选删除操作,通过servlet获得多选框的value组,然后执行sql操作.如下: 1 @RequestMapping( "/delteCouse.do ...

  7. ES6函数剩余参数(Rest Parameters)

    我们知道JS函数内部有个arguments对象,可以拿到全部实参.现在ES6给我们带来了一个新的对象,可以拿到除开始参数外的参数,即剩余参数(废话好多 O(∩_∩)O~). 这个新的对象和argume ...

  8. 宏参数(Arguments)的扩展

    宏分为两种,一种是 object-like 宏,比如: #define STR "Hello, World!" 另一种是 function-like 宏,比如: #define M ...

  9. JS函数arguments数组获得实际传参数个数

    JS与PHP在函数传参方面有点不同,PHP形参与实参个数要匹配,而JS就灵活多了,可以随意传参,实参比形参少或多都不会报错. 实参比形参多不会报错 ? 1 2 3 4 5 function say(a ...

随机推荐

  1. float 常见用法与问题--摘抄

    float 属性绝对是众多切图仔用的最多的 CSS 属性之一,它的用法很简单,常用值就 left.right.none 三个,但是它的特性你真的弄懂了吗? 我会在这里介绍我对 float 的认识与使用 ...

  2. Scrapy学习-18-去重原理

    Scrapy去重原理 scrapy本身自带一个去重中间件 scrapy源码中可以找到一个dupefilters.py去重器   源码去重算法 # 将返回值放到集合set中,实现去重 def reque ...

  3. Memcached简单介绍

    Memcached简单介绍 简介:Memcached是一个自由开源的,高性能,分布式内存对象缓存系统.================================================= ...

  4. LeetCode OJ--Rotate Image

    http://oj.leetcode.com/problems/rotate-image/ 将矩阵顺时针旋转90度.要求为原地算法. 注意对输入的测试,矩阵为空,长度为1,为2时…… #include ...

  5. windows下git使用

    一. 下载及安装 下载  git2.14.1 64bit https://git-for-windows.github.io/(官网下载不动) http://download.csdn.net/dow ...

  6. 牛客网 牛客练习赛7 D. 珂朵莉的无向图(多源BFS)

    题目链接  Problem D 比赛的时候完全想不到 直接对给定的这些点做多源$BFS$,把给定的这些点全都压到队列里,然后一个个做. 最后统计被访问的点的个数即可. #include <bit ...

  7. Usaco_Contest_2013_Open_Bovine Problem 1. Bovine Ballet

    Problem 1: Bovine Ballet [Brian Dean, 2013] In an attempt to challenge the stereotypical perception ...

  8. putnik

    可将旅行商的路线看作是从n - 1号点出发, 跳着到0号点, 再折返走完之前跳过的点. 想到这个, 暴力就可以得50分. 正解是DP. f[i][j](i > j)表示, 从i开始跳, 并返回至 ...

  9. 邁向IT專家成功之路的三十則鐵律 鐵律十五:IT人生活之道-赤子之心

    人的年齡與身體可以因歲月的無情不斷老化,但我們的這一顆心可千萬不要跟著老化.身為IT工作者的我們,每天除了要面對那死板僵硬的電腦挑戰之外,可能還要面臨許多人事方面的紛擾.這時候如果在平日的生活之中,仍 ...

  10. 【android】getDimension()、getDimensionPixelOffset()和getDimensionPixelSize()区别详解

    在自定义控件中使用自定义属性时,经常需要使用java代码获取在xml中定义的尺寸,相关有以下三个函数 getDimension() getDimensionPixelOffset() getDimen ...