Users Pricing

articles

home / developersection / articles / method overloading

Method Overloading

Anonymous User 4154 17 Jul 2010 Updated 04 Mar 2020

In method overloading method performs the different task at the different input

parameters with same method name and in same class.  

Example

To explain the concept of overloading I have created two classes Poly

    public class poly
    {
//these two functions, sum(), are overloaded.
        public int sum(int x, int y)
        {
            return (x + y);
        }
        public virtual int sum(int x, int y, int z)
        {
            return (x + y + z);
        }
    }

 

 

 


I am a content writter !


2 Comments


Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md