You are on page 1of 3

Implimenting Polymorphism and Inheritance in C#.NET The Signature of a method must be unique in the class in which is declared.

. The signature of method consists of the name of the method,modifiers,types of its parameters the number of parameters. The signature of the method does not include the return type. Function overloading A function overloading can be compared with person overloading. In the function overloading a function which is already have some work to do and if it is assigned with a different work which can be said as function overloading. When data types of the argument are changed Consider a function like: Add(int a,int b) { } We can call the above function by using two arguments like Add(10,20) But if we to call the above function by passing different data type value like add(10.5,20),we cannot use the above function and we overload the function like.

Add(float a,float b) { } When number of arguments are changed Consider a function like: Add(int a,int b) { } We can call the above function by passing two arguments like Add(10,20). If we want to call the above function with different number of arguments like(10,20,30) We cannot use the above function and we overload our function like Add(int a,int b,int c) { } Definition Providing new implmentations to a function with different signature is known as function overloading. In general function overloading is implemented with in same class. Operator overloading

Every operator has some pre-defined work given by the designers if we assigns additional work apart from the exisiting work to any operator is overloaded.

You might also like