Here's a summary of the different parameter modifiers and how the behavior changes for each, when using them with value-typed and reference-typed variables.

  • No modifier - value types

    • Copy of value passed to method
    • Method can read value
  • No modifier - reference types
    • Reference to object passed to method
    • Method can read/write object contents
  • ref modifier - value types
    • Reference to variable passed to method
    • Method can read/write variable
  • ref modifier - reference types
    • Reference to object reference passed to method
    • Method can read/write object contents
    • Method can change reference to point to new object
  • out modifier - value types
    • Reference to variable passed to method
    • Method must write new value to variable
  • out modifier - reference types
    • Reference to object reference passed to method
    • Method must change reference to point to new object

原文地址:#273 - Parameter Modifier Summary

【转载】#273 - Parameter Modifier Summary的更多相关文章

  1. 关于C#你应该知道的2000件事

    原文 关于C#你应该知道的2000件事 下面列出了迄今为止你应该了解的关于C#博客的2000件事的所有帖子. 帖子总数= 1,219 大会 #11 -检查IL使用程序Ildasm.exe d #179 ...

  2. Non-Nullable Types vs C#: Fixing the Billion Dollar Mistake (转载)

    One of the top suggestions (currently #15 on uservoice) for improving C# is the addition of non-null ...

  3. 一个操作Sql2005数据库的类(备份,还原,分离,附加,添加删除用户等操作)(转载)

    /* * 更新时间 :2011-09-01 16:06 * 更 新 人 :苏飞 */ using System; using System.Collections.Generic; using Sys ...

  4. 如何在Web项目中给没有添加API核心组件添加APIController的帮助页HelpPage

    前言: ASP.NET中的Web项目可以通过APIController控制器来为其他项目提供接口.  而我们在调试这些接口时,可以选择单元测试,网页测试(Get接口),自己写测试代码或者第三方测试工具 ...

  5. Jmeter_初步认识随笔

    1. 简介 Apache JMeter是100%纯java桌面应用程序,被设计用来测试客户端/服务器结构的软件(例如web应用程序).它可以用来测试包括基于静态和动态资源程序的性能,例如静态文件,Ja ...

  6. Log4NET简介

    log4net库是Apache log4j框架在Microsoft .NET平台的实现,是一个帮助程序员将日志信息输出到各种目标(控制台.文件.数据库等)的工具. 前提 最近做项目需要记录系统日志和用 ...

  7. Log4NET 数据库

    阅读目录 Log4NET简介 前提 详细步骤 回到顶部 Log4NET简介 log4net库是Apache log4j框架在Microsoft .NET平台的实现,是一个帮助程序员将日志信息输出到各种 ...

  8. Apache JMeter--网站自动测试与性能测评

    Apache JMeter--网站自动测试与性能测评 2013-02-28 15:48:05 标签:Jmeter From:http://bdql.iteye.com/blog/291987 出于学习 ...

  9. Redis配置主从复制

    Redis配置主从复制 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.操作环境介绍 1>.操作系统环境 [root@node101.yinzhengjie.org.cn ...

随机推荐

  1. 汉化Eclipse+配色方法(官方语言包)

    一. 汉化方法: 1.Eclipse版本查询:安装目录readme,查版本号;参照查代号如下表: 代号 平台版本 项目 主要版本发行日期 SR1发行日期 SR2发行日期 N/A 3.0 [1] N/A ...

  2. 求1+2+3+...+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)

    代码如下: public int Sum_Solution(int n) { int temp = n; boolean b = (temp>0)&&(temp += Sum_S ...

  3. VS2005 命令窗口的使用

    转自:http://www.cnblogs.com/RobotH/archive/2008/05/29/1209856.html 命令”窗口用于直接在 Visual Studio 集成开发环境 (ID ...

  4. 使用solr的函数查询,并获取tf*idf值

    1. 使用函数df(field,keyword) 和idf(field,keyword). http://118.85.207.11:11100/solr/mobile/select?q={!func ...

  5. 关于js-binding中Layer触摸事件的优化

    关于js-binding中Layer触摸事件的优化 cocos2d-x 3.7 1. 目前js中监听触摸事件带来的不便(特别是cocosbuilder) 在目前的js-binding中,如果要监听la ...

  6. 存储过程中的where in实现

    在项目中使用Npoco时发现where in查询总是不能起作用.寻觅了许久终于找到解决方案,特此记录下: ) Set @p='CoreRole,CorePassword,CoreOnlineUser' ...

  7. 一些英文面试题(Android)

    Describe the APK format. The APK file is compressed the AndroidManifest.xml file, application code ( ...

  8. UILabel的简单用法和实际操作

    1.UILabel   **//设置文字 label.text = @"欢迎收看灌篮高手,我是安溪教练";**//设置文字颜色label.textColor = [UIColor  ...

  9. MFC简易画图

    开发一个MFC绘图程序,基于"文档-视图"结构,在客户区能够完成: ①画直线 ②画矩形 ③画圆(椭圆) ④画任意折线(右键结束) ⑤画任意多边形(右键结束,并形成闭环) 注:图形中 ...

  10. EL 标准格式时间 转换成 常用时间yyyy-MM-dd

    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%><fmt:format ...