[Mono-list] Re: Final method in C# (as the final keyword in Java)
    Ympostor 
    ympostor at clix.pt
       
    Tue May 30 11:14:05 EDT 2006
    
    
  
Thanks for your answer!
Robert Jordan escribió:
>> 1) How can I call DontOverrideMe by a the Father reference?
> 
> Father f = new Son ();
> f.DonOverrideMe ();
Ok!
>> 3) How can I avoid declaring a GrandFather class (now I am using it 
>> because otherwise I am unable to use the sealed keyword in a method).
> 
> Make the method non-virtual.
By default, all methods are non-virtual. So, as it is hasn't got the 
virtual keyword, it is non-virtual already, am I right? But that doesn't 
eliminates the need of the override keyword at the sealed method... :-/
Regards.
-- 
    
    
More information about the Mono-list
mailing list