講下佛法

來源:互聯網
上載者:User

今天我們談論下佛法。

佛曰:空即是色, 色即是空。

 

用我們的專業屬於就是:空可以賦給任何類, 任何類都可以賦值為空白。

萬物皆對象, 空, 也不例外。

但是佛法一項是繞到你頭疼的一個東西。 他也認為,

對的也是錯的, 錯的也是對的。 諸如此類一個老和尚能把你說得頭暈轉向的東西。

所以空, 又什麼都不是。

 

這個如何理解呢?

 

C#代碼,

我們舉例如下:

        static void Main(string[] args)
        {
            Console.WriteLine(null is Form);
            Console.WriteLine(null is Button);
            Console.WriteLine(null is TrackBar);
            Console.WriteLine(null is DomainUpDown);
            Console.WriteLine(null is Graphics);
            Console.WriteLine(null is string);
            Console.WriteLine(null is Array);
        }

程式輸出:

False
False
False
False
False
False
False
請按任意鍵繼續. . .

額, 看起來似乎空什麼都不是額。。

所有的判斷都是false, 說明空不是任意

對象

這裡我僅僅舉例了一些從參考型別繼承的。 實值型別的就更不用說了。

但是另一面確是這個樣子的:

        static void Main(string[] args)
        {
            TestMethod1(null);
            TestMethod2(null);
            TestMethod3(null);
            TestMethod4(null);
            TestMethod5(null);
            TestMethod6(null);
            TestMethod7(null);
        }

        public static void TestMethod1(Form value)
        { }
        public static void TestMethod2(Button value)
        { }
        public static void TestMethod3(TrackBar value)
        { }
        public static void TestMethod4(DomainUpDown value)
        { }
        public static void TestMethod5(Graphics value)
        { }
        public static void TestMethod6(string value)
        { }
        public static void TestMethod7(Array value)
        { }

 

嘗試編譯這段代碼, 運行良好。。

也就是僅僅從類型判斷的話, 空是所有對象。

 

這就困惑了吧, 到底空是不是色?null是不是對象?

 

這也就是程式設計大師一般都反對教條類學生“追究最根本原理”的原因之一。

 

我相信到這裡很多人已經心領神會了。

對應下開頭。

 

本講結束。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.