8.19. Summary

C# provides a rich set of operators that fall under many categories. Except for a few C#-specific operators (pointer operators, checked, unchecked, is, as, sizeof, and typeof), most of the operators and their meanings are similar to their counterparts in Java. The operator precedence rules of C# are also similar to those of Java.

C# allows operator overloading of certain operators. When evaluating operators, the runtime first checks for any user-defined operator overloading and uses that definition (if any) instead of the predefined meaning of the operator. User-defined operator declarations cannot modify the syntax, precedence, or associativity of an operator. A user-defined operator cannot have the same signature as a predefined ...

Get .NET for Java Developers: Migrating to C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.