Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Explain how viewstate is being formed and how it's stored on client in .net?

989


Sql Queries: A Table will be given Omiting Duplicate rows and adding a new column

2387


What are the different.net tools which you used in projects?

1001


Tell us the difference between managed and unmanaged code?

1028


Which file is taken by compiler when we have both file Application and Server Configuration file?

2126


Do you know what is lambda expressions in c#?

1072


What is .net technology?

1043


What is "common language runtime" (clr) in .net?

1071


How to convert a .NET object into COM operabililty?

1067


What are nullable types in .NET

1161


Please explain what is heap and what is stack?

1008


Explain how to redirect tracing to a file?

1016


State the differences between the dispose() and finalize().

1040


What are the core differences between .NET Languages ?

2392


What are virtual destructures?

1102