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 |
What?s an interface class?
What is the advantage of static class in c#?
Explain about Destructor method?
How can you achieve run time polymorphism in C#?
What is the use of generics in c#?
How can you reference current thread of the method ?
how do you do exception management
How to exclude a property from xml serialization?
What is the difference between abstract class and interface in c#?
What is difference between constants and readonly in c#?
Can an interface inherit class/abstract class.
Why do we use constructors in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)