Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

< Operator (C# Reference)

All numeric and enumeration types define a "less than" relational operator (<) that returns true if the first operand is less than the second, false otherwise.

User-defined types can overload the < operator (see operator). If < is overloaded, > must also be overloaded. When a binary operator is overloaded, the corresponding assignment operator, if any, is also implicitly overloaded.

class LT
{
    static void Main()
    {
        Console.WriteLine(1 < 1.1);
        Console.WriteLine(1.1 < 1.1);
    }
}
/*
Output:
True
False
*/
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.