Method Overloading.

Total Post:9


 2384  View(s)
Rate this:
What is Method OverLoading?
  1. Re: Method Overloading.

    It is possible to define two or more methods within the same class that having the same name, as long as their parameter declarations are different. When this is the case, the methods are said to be overloaded, and the process is referred to as method overloading.

    Same method name but having different types of signatures in the same scope.

    public class AddNumber
    public int Add(int x, int y)
    return x+y;
    public int Add(int x, int y, int z)
    return x+y+z;

    We define a Add method, in two different versions. The first one takes two paramaters, for adding two numbers, while the second version takes three parameters.

      Modified On Mar-29-2018 03:38:35 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.