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

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

How's method overriding different from overloading?

Posted By :Shashi Ray     Posted Date :December 11, 2009    Points :10   Category :.NET Framework 
When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.

You can also find related Interview Question to How's method overriding different from overloading?  below: 

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 Method overloading?

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

What is Method Overriding? How to override a function in C#?

Use the override modifier to modify a method, a property, an indexer, or an event. An override method provides a new implementation of a member inherited from a base class. The method overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method.
You cannot override a non-virtual or static method. The overridden base method must be virtual, abstract, or override. (More...)

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.

Can we call a base class method without creating instance?

Its possible If its a static method.

Its possible by inheriting from that class also.

Its possible from derived classes using base keyword. (More...)

What is Method used to bind the data into gridview ?

DataBind() Method used to bind the data into gridview (More...)

What method is used to place a value onto the top of a stack?

push() method, Push is the direction that data is being added to the stack. push() member method places a value onto the top of a stack. (More...)

What method removes the value from the top of a stack?

The pop() member method removes the value from the top of a stack, which is then returned by the pop() member method to the statement that calls the pop() member method. (More...)

How can you reference current thread of the method ?

"Thread.CurrentThread" refers to the current thread running in the method."CurrentThread" is a public static property. (More...)

How do I call a member method and pass a primitive type (Value Type) by reference?

Use the ref keyword when declaring the parameter of the method, for example:

public bool GetValue( ref int returnValue );

This will pass the numeric by reference.You can modify the value of returnValue within the body of GetValue and it will persist when the method call returns. (More...)

How can I look up a parent class method or property of any System-level object?

Use the Class View window, accessed from the standard toolbar by clicking View | Class View. (More...)

difference between Shadowing and overriding

Overriding redefines only the implementation while shadowing redefines the whole element.On the other side In overriding derived classes can refer the parent class element by using "ME" keyword, but in shadowing you can access it by "MYBASE". (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