Re: pure virtual (as in C++)
From: Sean Hederman (usemy_at_blogentry.com)
Date: 03/07/05
- Next message: jralford: "re:Accessing properties of multiple (different) controls"
- Previous message: Sean Hederman: "Re: Specialization with generics"
- In reply to: Richard Blewett [DevelopMentor]: "Re: pure virtual (as in C++)"
- Next in thread: Vadim Berezniker: "Re: pure virtual (as in C++)"
- Messages sorted by: [ date ] [ thread ]
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
> }
> }
>
>
>
- Next message: jralford: "re:Accessing properties of multiple (different) controls"
- Previous message: Sean Hederman: "Re: Specialization with generics"
- In reply to: Richard Blewett [DevelopMentor]: "Re: pure virtual (as in C++)"
- Next in thread: Vadim Berezniker: "Re: pure virtual (as in C++)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|