OneCompiler

Polymorphism with overloading(Compile Time Overloading)

150

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace HelloWorld
{
public class polym{

public int sum(int a, int b)
{
return a+b;
}

public string sum(string a, string b)
{
return a+ b;
}
}

public class Program
{
	public static void Main(string[] args)
	{
		var obj= new  polyma
		
		Console.WriteLine(obj.sum(12,54));
		Console.WriteLine(obj.sum("Hello","Madam"));
	}
}

}