GeekInterview.com
Series: Subject: Topic:
Question: 322 of 577

When, where and why we are using overloading and overriding???

Asked by: spidervijay | Member Since Mar-2006 | Asked on: Jun 14th, 2006

View all questions by spidervijay

Showing Answers 1 - 4 of 4 Answers
prosenjit roy chowdhury

Answered On : Jun 15th, 2006

We use

  
Login to rate this answer.
Meena

Answered On : Jul 8th, 2006

OverloadIf One class can have more than one methods with the same name, it is called as Overloding.OverriddingIn inheritance, we can use the method which has the same name in Base and derived class , is called overriding.

  
Login to rate this answer.
fine questions

Answered On : Jul 11th, 2006

Overloading is resolved at compile time and overriding is resolved at run time.

  
Login to rate this answer.
Vivek

Answered On : Jul 31st, 2006

overloading  :- Same method name,Different signature and return type doesn't matter.Overloading is generally used in same class.methods which perform the same task but in different wasy are given the same namFor eg Draw(float radius) method can be used to draw a circle,Draw(float side) can be used to draw square or  Draw(float base,float height)can be used to draw triangle.Name of the methods is same as they all draw a figure.Overriding :- Same method name,same signature and same return type also.It is used in inheritance.When a subclass method wants to hide a superclass method it can use overriding.That means it can implement a method in the way it wants.In such case the superclass method is hidden.to call the superclass method ,'super' keyword has to used with the method name.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.