EXAMPLE OF METHOD OVERLOADING IN JAVA?

Total Post:341

Points:2389
Java  OOPS 
 1161  View(s)
Ratings:
Rate this:
method overloading in java
  1. 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;
            }

      Modified On Apr-05-2018 11:29:12 PM

Answer

NEWSLETTER

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