overriding,shadowing concept

Discussion in 'ASP .Net' started by sangam via .NET 247, Apr 30, 2004.

  1. (Type your message here)
    exact differences between overriding,shadowing,overloading

    --------------------------------
    From: s sangameshwaran

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>3XFrGLe3gE25wdH7Xp+nnw==</Id>
     
    sangam via .NET 247, Apr 30, 2004
    #1
    1. Advertising

  2. sangam via .NET 247

    Sanjeeva Guest

    Overriding or shadowing is same...

    The difference between Override and Overload is

    some method in the base class is overriden in the derived class without any
    change in the function prototype or signature like this.


    Class Base1{

    virtual protected DoSomething(){
    //stuff
    }
    }

    Class Derived1 : Base1{

    protected override DoSomething(){
    // different stuff.
    }
    }


    Overloading is in the same class defining defferent versions of the same
    method based on the number and type of the parameter list.
    Example like this..

    Class SomeOne{
    public string GetInfo( int i ){
    //Some stuff
    }

    public string GetInfo( string s) {
    //Some stuff
    }

    public string GetInfo( int i, int j) {
    //Some stuff
    }

    }



    "sangam via .NET 247" <> wrote in message
    news:...
    > (Type your message here)
    > exact differences between overriding,shadowing,overloading
    >
    > --------------------------------
    > From: s sangameshwaran
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>3XFrGLe3gE25wdH7Xp+nnw==</Id>
     
    Sanjeeva, Jun 23, 2004
    #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. Nick Stansbury

    Shadowing Question

    Nick Stansbury, Nov 16, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    490
    Scott Allen
    Nov 16, 2004
  2. Aguilar, James

    Shadowing a parameter

    Aguilar, James, Aug 8, 2004, in forum: C++
    Replies:
    3
    Views:
    22,710
    Peter Ammon
    Aug 9, 2004
  3. Michael Hoffman
    Replies:
    3
    Views:
    482
    Bruno Desthuilliers
    Mar 19, 2005
  4. John Salerno

    question about shadowing built-in names

    John Salerno, May 23, 2006, in forum: Python
    Replies:
    2
    Views:
    290
    John Salerno
    May 23, 2006
  5. jc
    Replies:
    1
    Views:
    1,396
    Neredbojias
    Mar 19, 2008
Loading...

Share This Page