What are the different ways a method can be overloaded

 Posted by Pardhu2020 on 2/18/2014 | Category: C# Interview questions | Views: 630 | Points: 40
Answer:

Different parameter data types, different number of parameters, different order of
parameters.

example:
int area(int a, int b) 

{
return a*b; --different number of parameters
}
int area(int b)
{
return a*a;
}
parameter return types

int calc(int a)
{
return a;
}

double calc(double b)
{
return b*5;
}


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response