All numeric and enumeration types define a "greater than" relational operator (>) that returns true if the first operand is greater than the second, false otherwise.
expr1 > expr2
Where:
User-defined types can overload the > operator (see operator). If > is overloaded, < must also be overloaded.
// cs_operator_greater_than.cs
using System;
class Test
{
public static void Main()
{
Console.WriteLine(1.1 > 1);
Console.WriteLine(1.1 > 1.1);
}
}
True False
C# Operators |