using System;
namespace Test
{
public class Program
{
private static void Main(string[] args)
{
//bool Equal = Calculator.AreEqual(1, 2);
bool Equal = Calculator<int>.AreEqual(10, 10);
if (Equal)
{
Console.WriteLine("Equal");
}
else
{
Console.WriteLine("Not Equal");
}
}
}
public class Calculator<T>
{
//public static bool AreEqual(int Value1, int Value2) - just allowed int type
//public static bool AreEqual(object Value1, object Value2) // all type allowed
public static bool AreEqual(T Value1, T Value2) // making Generic - making independent for type
{
return Value1.Equals(Value2);
}
}
}