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

最新文章

  1. 菜鸟学Struts2——Interceptors
  2. MD5加密与验证
  3. bzoj2819 Nim
  4. Linux学习笔记(12)用户和用户组管理
  5. Magicodes.WeiChat——多租户的设计与实现
  6. cf 621D
  7. ROS创建工作空间(三)
  8. Hbase物理模型
  9. Tengine新增健康检查模块
  10. [Webpack 2] Intro to the Production Webpack Course
  11. Java基础知识强化之IO流笔记01:异常的概述和分类
  12. Java单线程文件下载,支持断点续传功能
  13. for循环 + setTimeout 结合的烂大街的面试题
  14. vue初尝试--新建项目
  15. 微信小程序如何像vue一样在动态绑定类名
  16. php的api接口
  17. 用WSDL4J解析types标签中的内容
  18. svn 创建branch merge
  19. maven依赖包冲突解决思路
  20. android中MVP模式(一) - 清风明月的专栏 - CSDN博客

热门文章

  1. 汉化Eclipse+配色方法(官方语言包)
  2. linux下的ls命令
  3. php namespace use 命名空间
  4. 自学Linux命令的四种方法
  5. 计算圆周率 Pi (π)值, 精确到小数点后 10000 位 只需要 30 多句代码
  6. 关于Android悬浮窗要获取按键响应的问题
  7. WPF 之 style文件的引用
  8. L - Abbott's Revenge(比较复杂的bfs)
  9. java对象创建过程
  10. C++-copy constructor、copy-assignment operator、destructor