<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # null(C# 參考) **null** 關鍵字是表示不引用任何對象的 null 引用的文字值。 **null** 是引用類型變量的默認值。普通值類型不能為 null。但是,C# 2.0 引入了可以為 null 值的類型。請參見 [可以為 null 的類型(C# 編程指南)](https://msdn.microsoft.com/zh-cn/library/1t3y8s4s.aspx)。 下面的示例演示 null 關鍵字的一些行為: ``` class Program { class MyClass { public void MyMethod() { } } static void Main(string[] args) { // Set a breakpoint here to see that mc = null. // However, the compiler considers it "unassigned." // and generates a compiler error if you try to // use the variable. MyClass mc; // Now the variable can be used, but... mc = null; // ... a method call on a null object raises // a run-time NullReferenceException. // Uncomment the following line to see for yourself. // mc.MyMethod(); // Now mc has a value. mc = new MyClass(); // You can call its method. mc.MyMethod(); // Set mc to null again. The object it referenced // is no longer accessible and can now be garbage-collected. mc = null; // A null string is not the same as an empty string. string s = null; string t = String.Empty; // Logically the same as "" // Equals applied to any null object returns false. bool b = (t.Equals(s)); Console.WriteLine(b); // Equality operator also returns false when one // operand is null. Console.WriteLine("Empty string {0} null string", s == t ? "equals": "does not equal"); // Returns true. Console.WriteLine("null == null is {0}", null == null); // A value type cannot be null // int i = null; // Compiler error! // Use a nullable value type instead: int? i = null; // Keep the console window open in debug mode. System.Console.WriteLine("Press any key to exit."); System.Console.ReadKey(); } } ``` ## C# 語言規范 有關詳細信息,請參閱 [C# 語言規范](https://msdn.microsoft.com/zh-cn/library/ms228593.aspx)。該語言規范是 C# 語法和用法的權威資料。 ## 請參閱 [C# 參考](https://msdn.microsoft.com/zh-cn/library/618ayhy6.aspx) [C# 編程指南](https://msdn.microsoft.com/zh-cn/library/67ef8sbd.aspx) [C# 關鍵字](https://msdn.microsoft.com/zh-cn/library/x53a06bb.aspx) [文字關鍵字(C# 參考)](https://msdn.microsoft.com/zh-cn/library/23954zh5.aspx) [默認值表(C# 參考)](https://msdn.microsoft.com/zh-cn/library/83fhsxwc.aspx) [Nothing (Visual Basic)](https://msdn.microsoft.com/zh-cn/library/0x9tb07z.aspx)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看