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也只是在一个块里面有作用哦!!!!!!!!!!!

  • 相关阅读:
    鸡尾酒之白兰地
    Hadoop面试总结(三)Hbase、Spark
    Hadoop面试总结(二)MySQL
    Hadoop面试总结(一)Linux命令、Scala
    View
    用户画像项目规划
    Apache kafka
    Resume
    蔡学镛
    【git】git常用操作
  • 原文地址:https://www.cnblogs.com/xiangxiangyuan/p/1302445.html
Copyright © 2011-2022 走看看