站内搜索: 请输入搜索关键词
当前页面: 图书首页 > NET For Java Developers Migrating To C#

NET For Java Developers Migrating To C#

[ directory ] Previous Section Next Section

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 operator.

    [ directory ] Previous Section Next Section