zoukankan      html  css  js  c++  java
  • 【转载】#273

    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

  • 相关阅读:
    uniapp开发注意事项
    uniapp生成海报带二维码及保存
    严格模式的this
    数据类型
    短路特性
    第九周程序改错
    矩阵转置
    二分法求根
    三天打鱼两天晒网
    LeetCode7
  • 原文地址:https://www.cnblogs.com/yuthreestone/p/3591953.html
Copyright © 2011-2022 走看看