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

  • 相关阅读:
    php apc
    nginx https
    js弹出确认框,挺全
    websocket nodejs
    nodejs express测试
    【C++】Mandelbrot集绘制(生成ppm文件)
    【Scheme】Huffman树
    【Scheme】符号求导
    【Scheme】树结构
    【Scheme】序列的操作
  • 原文地址:https://www.cnblogs.com/xiangxiangyuan/p/1302445.html
Copyright © 2020-2023  润新知