Private Virtual Method

Discussion in 'ASP .Net' started by rn5a@rediffmail.com, Oct 16, 2007.

  1. Guest

    Can't a method be declared as Private Virtual? If yes, then why?

    Thanks,

    Ron
     
    , Oct 16, 2007
    #1
    1. Advertising

  2. Hi Ron,

    MSDN says
    The virtual keyword is used to modify a method, property, indexer or event
    declaration, and allow it to be overridden in a derived clas.
    You cannot use the virtual modifier with the static, abstract, private or
    override modifiers.
    The new class—the derived class— gains all the non-private data and behavior
    of the base class in addition to any other data or behaviors it defines for
    itself.

    So why we would need a private virual method as it wouldn't be overridden in
    the derived class because it would not have acces to it.

    So exactly in which scenario do you wnat a private virtual method?

    Regards,
    Nishant Rana
     
    =?Utf-8?B?TmlzaGFudCBSYW5h?=, Oct 16, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Calvin Lai
    Replies:
    7
    Views:
    568
    Calvin Lai
    Dec 18, 2003
  2. qazmlp
    Replies:
    19
    Views:
    818
    Daniel T.
    Feb 4, 2004
  3. jlopes
    Replies:
    7
    Views:
    438
    jlopes
    Nov 19, 2004
  4. John Goche
    Replies:
    10
    Views:
    785
    Marcus Kwok
    Dec 8, 2006
  5. earthwormgaz
    Replies:
    6
    Views:
    463
    earthwormgaz
    Jun 1, 2010
Loading...

Share This Page