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

  • 相关阅读:
    图床_shell命令grep/egrep
    图床_shell命令vi/vim
    图床_shell命令tr
    图床_shell命令wc
    图床_shell命令vimdiff
    图床_shell命令diff
    图床_shell命令rev
    图床_shell命令cut
    图床_shell命令tail
    图床_shell命令head
  • 原文地址:https://www.cnblogs.com/xiangxiangyuan/p/1302445.html
Copyright © 2011-2022 走看看