overriding,shadowing concept

  • Thread starter sangam via .NET 247
  • Start date
S

sangam via .NET 247

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

Sanjeeva

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
}

}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top