Re: pure virtual (as in C++)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Sean Hederman (usemy_at_blogentry.com)
Date: 03/07/05


Date: Mon, 7 Mar 2005 07:06:42 +0200

Whoops! Yeah, thanks.

"Richard Blewett [DevelopMentor]" <richardb@NOSPAMdevelop.com> wrote in
message news:uXhi26pIFHA.2956@TK2MSFTNGP12.phx.gbl...
> Note that you have to mark the class as abstract if it has any abstract
> methods or properties
>
> abstract class Foo
> {
> public abstract void Bar();
> }
>
> Regards
>
> Richard Blewett - DevelopMentor
> http://www.dotnetconsult.co.uk/weblog
> http://www.dotnetconsult.co.uk
>
> "Vadim Berezniker" <vadim@berezniker.com> wrote in message
> news:uo6SyDpIFHA.3076@tk2msftngp13.phx.gbl...
> > Vadim Berezniker wrote:
> >> sadhu wrote:
> >>
> >> I would like to be able to access the method via the base class name.
> >> If I declare it as non-abstract and make a call via the base class
> >> name,
> >> the base class's method will be invoked and not the child class'.
> >
> > Oh man. What's wrong with me... I think I need to go to sleep.
> > I can just mark the method as virtual. Sorry for the dumb questions.
> > I am not thinking straight.
>
> ;D
>
> If you mark the method as abstract, the virtual is implied.
>
> public MyClass {
> public abstract void PureMethod(); // Pure
> public virtual void VirtualMethod() { // Virtual
> }
> }
>
>
>



Relevant Pages

  • Re: pure virtual (as in C++)
    ... Note that you have to mark the class as abstract if it has any abstract methods or properties ... >> I would like to be able to access the method via the base class name. ... public abstract void PureMethod(); // Pure ... public virtual void VirtualMethod() {// Virtual ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Differences in Aptitude
    ... Yeah, the latter is supposedly a real turn on with these Alpha type ... Mark, you're not a strong man either. ... buying a condo is not a good investment so she ... So the women who gestate children for men who clearly abandon ...
    (soc.men)
  • Re: BBC-Womens health fuelling poverty
    ... >> Mark Sobolewski wrote: ... And more women are going to college these ... > Yeah, nice to know that America has a healthy supply of lawyers ... >>> income with other family members. ...
    (soc.men)
  • Re: A problem with a cd player
    ... Yeah, I know that Mark. ... Don't worry, as your daughter gets older, ... As long as you're still waking up... ...
    (sci.electronics.repair)
  • Re: A problem with a cd player
    ... Yeah, I know that Mark. ... Don't worry, as your daughter gets older, ... waking up in the morning feeling worse than I did when I went to bed ... ...
    (sci.electronics.repair)