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


How can you overload a method?

Answers were Sorted based on User's Feedback



How can you overload a method?..

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

How can you overload a method?..

Answer / swapna

we can overload a method by giving same method names with
different parameters. Parameters may differ in data type or
in number.
This is called method overloading .

Is This Answer Correct ?    1 Yes 0 No

How can you overload a method?..

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

Post New Answer

More C Sharp Interview Questions

What?s an interface class?

5 Answers   Mind Tree,


What is the advantage of static class in c#?

0 Answers  


Explain about Destructor method?

0 Answers  


How can you achieve run time polymorphism in C#?

0 Answers   Hexaware,


What is the use of generics in c#?

0 Answers  


How can you reference current thread of the method ?

0 Answers  


how do you do exception management

4 Answers   Accenture, HCL,


How to exclude a property from xml serialization?

0 Answers  


What is the difference between abstract class and interface in c#?

0 Answers  


What is difference between constants and readonly in c#?

0 Answers  


Can an interface inherit class/abstract class.

1 Answers   Synechron,


Why do we use constructors in c#?

0 Answers  


Categories