How can you overload a method?
Answers were Sorted based on User's Feedback
Answer / rakesh
A class contains more than one function with the same name
but different method signature ie different access
type,return type,parameters.
public void int sum(int i,int j)
{
int tot=i+j;
Console.WriteLine(tot);
}
public void double sum(double p,double q)
{
double tot=p+q;
Console.WriteLine(tot);
}
if we are passing integer values means the first function
will invoke,and if we are passing double values means the
second will work.This is method overloading.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / niraj bajaj
Hi
@Rakesh
Return types doesnt include in these..
only different set of parameters and their access types..
Is This Answer Correct ? | 0 Yes | 0 No |
Is string nullable in c#?
What is the main method?
What is the difference between dictionary and hashtable in c#?
How much time will it take to learn unity?
What is the relation between classes and objects?
Does c# support a variable number of arguments?
What is data adapter in c#?
What is the solution if you need to manipulate sets of items?
Does c# have a 'throws' clause?
How can I get the ascii code for a character in c#?
what is the fastest way to concatenate strings in c sharp?
What is virtual class in C#?