EXAMPLE OF METHOD OVERLOADING IN JAVA?

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
Java  OOPS 
 949  View(s)
Ratings:
Rate this:
method overloading in java
  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: Example of Method overloading in java?

    try this:

    public int Sum(int a, int b)

            {

                return a + b;

            }

     

            public double Sum(double a, double b)

            {

                return a + b;

            }

            public int Sum(int a, int b)

            {

                return Sum(a, b, 0);

            }

     

            public int Sum(int a, int b, int c)

            {

                return a + b + c;

            }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!