I wrote this code in C#:
public static double method ()
{
return 1.3;
}
public static Boolean methodO(object o)
{
return o.Equals(1.3);
}
public static void Main()
{
System.Console.WriteLine(methodO(method())); // prints 'true'
}
Why does this compile?
Is this because "everything in C# is an object", and so even if it's a primitive type it's an object too and so it implements the "Equals" method?