.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani

Home >> Interview Question >> OOPS >> Post New Question Subscribe to Interview Questions

What is Overloading?

Posted By :Narayanan     Posted Date :December 31, 2011    Points :40   Category :OOPS 
Overloading - is the concept of using one function or class in different ways by changing the signature of its parameters

You can also find related Interview Question to What is Overloading?  below: 

What is Method overloading?

Method overloading occurs when a class contains two methods with the same name, but different signatures. (More...)

How's method overriding different from overloading?

When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class. (More...)

How the concept of method overriding different from method overloading?

When overriding occurs on a method, you can change the behavior of the method for the class you have derived. Overloading a method involves in having another method with the same name within the class. (More...)

How is method overriding different from method overloading

When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves
having another method with the same name within the class.

what is difference between overloading and overriding


1. Overloading is the concept of compile time polymorphism whereas Overriding is the concept of runtime polymorphism
2. Overloading is same method name with different Signatures whereas Overriding is Methods name and signatures must be same.
3. Two functions having same name and return type, but with different type and/or number of arguments is called as Overloading whereas When a function of base class is re-defined in the derived class called as Overriding
4. It doesn't need inheritance. Whereas It needs inheritance.
5. Method can have different data types whereas Method should have same data type.
6. Method can be different access specifies whereas Method should be public.

How to deal with operation overloading while exposing the WCF services?

By default overload operations (methods) are not supported in WSDL based operation. However by using Name property of OperationContract attribute, we can deal with operation overloading scenario.

interface ICalculator


[OperationContract(Name = "AddInt")]

int Add(int arg1,int arg2);

[OperationContract(Name = "AddDouble")]

double Add(double arg1,double arg2);

Notice that both method name in the above interface is same (Add), however the Name property of the OperationContract is different. In this case client proxy will have two methods with different name AddInt and AddDouble. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend