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


Please Help Members By Posting Answers For Below Questions

How to debug failed assembly binds?

604


What is Complex Class in .NET?

610


Explain can 2 different applications use the same dll in gac at the same time?

579


What's singleton activation mode in .net?

614


What is an anonymous method?

531






Please explain what is a delegate?

693


Please explain what is reflection and what is it for?

503


Explain the garbage collection process?

639


Describe the difference between inline and code behind which is best in a loosely coupled solution?

2126


What are .net applications?

544


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....

1610


Explain security measures exist for .net remoting in system.runtime.remoting?

568


What is meant by globalization?

573


What versions of .net are there?

623


Is .net core free?

575