Re: Use 'new' keyword...

Alan Baljeu <[email protected]> Thu, 2 Nov 2006 11:53:30 -0500
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <[email protected]>
public new B Copy()
{
}

> -----Original Message-----
> From: Discussion relating to the specifics of the C# and
> Managed C++ languages [mailto:[email protected]]
> On Behalf Of Peter Osucha
> Sent: Thursday, November 02, 2006 11:51 AM
> To: [email protected]
> Subject: [DOTNET-CX] Use 'new' keyword...
>
> I have an object A that has a method called 'Copy' that
> returns a copy of itself.
>
> I have another object B that inherits from A (adding a few
> properties).  I also added a method called 'Copy' to object B
> that returns a copy of itself.
>
> On compilation of the project, I get the warning...
>
> Warning 1 'ETI.B.Copy()' hides inherited member
> 'ETI.A.Copy()'. Use the new keyword if hiding was intended.
>
> How do I use the 'new' keyword as suggested by the error
> message to get rid of this warning, please?
>
> Sincerely,
> Peter
>
> ===================================
> This list is hosted by DevelopMentor.  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com