What will happen,if we compile below function?

private double sum(int a, int b)
{
}

private int sum(int i,int j,int k)
{
}

Note:- In above both function return type is different but no of parameters are also different.

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

It will not compile,will give us an error saying that:-

"Type '_Default' already defines a member called 'sum' with the same parameter types"


Here _Default is a page name.

We can not say that it's a Function Overloading.Because it does not depend upon return type.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response