Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

polymorphism in C#

using System;

namespace polymor
{
    class Program
    {
        void Sum(int a, int b)
        {
            Console.WriteLine(a + b);
        }
       
        void Sum(int a, int b, int c)
        {
            Console.WriteLine(a + b + c);
        }
        void Sum(int a, int b, int c, int d)
        {
            Console.WriteLine(a + b + c + d);
        }
        static void Main(string[] args)
        {
           
           
            Program obj = new Program();
            obj.Sum(2,3);
            obj.Sum(2,3,4);
            obj.Sum(2, 3, 4,5);
            Console.ReadLine();
        }
    }
}
Comment

polymorphism in c#

public class X  
{  
    public virtual void A()  
    {  
    }  
}  
public class Y : X  
{  
    public override void A()  
    {  
    }  
}  
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity transform.translate 
Csharp :: how to create a point c# 
Csharp :: integer to boolean conversion in unity C# 
Csharp :: c# string contain double quote 
Csharp :: bitwise and c# 
Csharp :: c# mapper.map 
Csharp :: unity stack overflow error 
Csharp :: c# winforms input 
Csharp :: unity new input system get button down 
Csharp :: how to add default value to combobox in wpf 
Csharp :: make sprite invisible unity 
Csharp :: out variable in c# 
Csharp :: what does - in f#? 
Csharp :: how to backgrund c# red 
Csharp :: block nulltarge tpl dataflow 
Csharp :: .net directorysearcher get manager accountname 
Html :: html pound symbol 
Html :: default html template 
Html :: regex find html comment 
Html :: ion icon size small 
Html :: disable html form input autocomplete autofill 
Html :: fa icons profile 
Html :: box shadow svg css 
Html :: button open link in new tab 
Html :: facebook share link html 
Html :: youtube video image 
Html :: mobile prevent zoom 
Html :: how to add a title picture in html 
Html :: html starting tag 
Html :: how to add country flag in html 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =