Re: private new void



JJ,

In this case, the new is not related to the return type of the method.
Rather, new is used to indicate that the method shadows a method with the
same signature declared on the base class.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

<jjmraz@xxxxxxxxxxx> wrote in message
news:1135207592.004619.294280@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I have seen some code recently that had the following method
> signatures:
>
> private new void Push(object o)
>
> And
>
> public new objectname FunctionName()
>
> So my question is what is happening here? With the first one why would
> new be with a void return type? With the second one I am assuming that
> the function would return a new object of that type, correct?
>
> JJ
>


.