熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

C#編程中的 New 關鍵詞的幾種用法[3]

2022-06-13   來源: .NET編程 

new public class MyClass // nested type hiding the base type members
  
   {
  
   public int x = ;
  
   public int y;
  
   public int z;
  
   }
  
  
  
   public static void Main()
  
   {
  
   // Creating object from the overlapping class:
  
   MyClass S = new MyClass();
  
  
  
   // Creating object from the hidden class:
  
   MyBaseCMyClass S = new MyBaseCMyClass();
  
  
  
   ConsoleWriteLine(Sx);
  
   ConsoleWriteLine(Sx);
  
   }
  
   }
  


  輸出

  

  

[]  []  []  


From:http://tw.wingwit.com/Article/program/net/201311/14880.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.