i have 2 functions, int add(int a,int b);
double add(int a,int b); does this code implement
overloading? if not what will be the error?
Answer Posted / ar prabhakaran
C#: CIL supports overloading by return type
C# and most other languages that allow method overloading do
not allow overloading by return type. What this means is
that methods can be overloading only if they differ by
parameters. So the following code will not compile as the
methods differ only by return type
class Employee
{
//...
}
class Program
{
static int Func(Employee emp) {
return emp.Id;
}
static string Func(Employee emp) {
return emp.Name;
}
}
Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
How to debug failed assembly binds?
What is Complex Class in .NET?
Explain can 2 different applications use the same dll in gac at the same time?
What's singleton activation mode in .net?
What is an anonymous method?
Please explain what is a delegate?
Please explain what is reflection and what is it for?
Explain the garbage collection process?
Describe the difference between inline and code behind which is best in a loosely coupled solution?
What are .net applications?
object is physical and class is logical..here class is not occupying any memory as our definition of class but i got a question then the class where it stores if it is not occupying any memory....
Explain security measures exist for .net remoting in system.runtime.remoting?
What is meant by globalization?
What versions of .net are there?
Is .net core free?