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
Explain how viewstate is being formed and how it's stored on client in .net?
Sql Queries: A Table will be given Omiting Duplicate rows and adding a new column
What are the different.net tools which you used in projects?
Tell us the difference between managed and unmanaged code?
Which file is taken by compiler when we have both file Application and Server Configuration file?
Do you know what is lambda expressions in c#?
What is .net technology?
What is "common language runtime" (clr) in .net?
How to convert a .NET object into COM operabililty?
What are nullable types in .NET
Please explain what is heap and what is stack?
Explain how to redirect tracing to a file?
State the differences between the dispose() and finalize().
What are the core differences between .NET Languages ?
What are virtual destructures?