Can we define Method Overloading in different classes?

 Posted by vishalneeraj-24503 on 11/29/2013 | Category: OOPS Interview questions | Views: 1616 | Points: 40

No,we can not define Method Overloading in different classes.It must be on the same class.
As we know that Function Overloading is defined in the same class.

We can understand it by an example:-

Below function are an example of Overloaded Constructor,which are defined on the same class.

public class Person
public Person()

public Person(int person_id)

If we define same function in different classes,so they will not be called as function overloading.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response