zoukankan      html  css  js  c++  java
  • return 作用域

    今天在作题目的是的时候突然想到这个问题

         

       class TimePeriod
            {
                private double seconds;

                public virtual double Hours
                {
                    get { return seconds / 3600; }
                    set { seconds = value * 3600;}
                }
            }
        class TimePer : TimePeriod
        {
           
        }

            class Program1
            {
                static void Main()
                {
                    TimePeriod t = new TimePeriod();
                    // Assigning the Hours property causes the 'set' accessor to be called.
                    t.Hours = 24;
                    // Evaluating the Hours property causes the 'get' accessor to be called.
                    System.Console.WriteLine("Time in hours: " + t.Hours);
                }
            }

    c#是一种块结构代码

      return也只是在一个块里面有作用哦!!!!!!!!!!!

  • 相关阅读:
    MyBatis 自动关闭 session
    Sublime相关操作及配置
    CentOS yum换源并配置SSH
    SpringSecurity认证流程
    ES模块化的导入和导出
    Promise学习
    axios的使用
    SpringSecurity注解的使用
    Webpack笔记
    JAVA工具类
  • 原文地址:https://www.cnblogs.com/xiangxiangyuan/p/1302445.html
Copyright © 2011-2022 走看看