Re: overriding,shadowing concept
From: Sanjeeva (sanjeeva_at_proteans.com)
Date: 06/23/04
- Next message: Jose Luis Manners: "Re: Good .Net Books"
- Previous message: Jacques Wentworth: "Good .Net Books"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Jun 2004 20:46:51 -0700
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" <anonymous@dotnet247.com> wrote in message
news:u8UTYQrLEHA.1644@TK2MSFTNGP09.phx.gbl...
> (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>
- Next message: Jose Luis Manners: "Re: Good .Net Books"
- Previous message: Jacques Wentworth: "Good .Net Books"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|