2010-03-30 Jb Evain <jbevain@novell.com>
[mcs.git] / docs / ecma334 / 17.2.6.3.xml
blobe29d71e3bb20d36e025cc3e61a81b36f05191aac
1 <?xml version="1.0"?>
2 <clause number="17.2.6.3" title="Hiding">
3   <paragraph>A nested type may hide (<hyperlink>10.7.1.1</hyperlink>) a base member. The new modifier is permitted on nested type declarations so that hiding can be expressed explicitly. <example>[Example: The example <code_example><![CDATA[
4 using System;  
5 class Base   
6 {  
7    public static void M() {  
8       Console.WriteLine("Base.M");  
9    }  
10 }  
11 class Derived: Base   
12 {  
13    new public class M   
14    {  
15       public static void F() {  
16          Console.WriteLine("Derived.M.F");  
17       }  
18    }  
19 }  
20 class Test   
21 {  
22    static void Main() {  
23       Derived.M.F();  
24    }  
25 }  
26 ]]></code_example>shows a nested class M that hides the method M defined in Base. end example]</example> </paragraph>
27 </clause>