|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
() Operator (C# Reference)
In addition to being used to specify the order of operations in an expression, parentheses are used to perform the following tasks:
Specify casts, or type conversions.
Invoke methods or delegates.
The () operator cannot be overloaded.
For more information, see Casting and Type Conversions (C# Programming Guide).
A cast expression could lead to ambiguous syntax. For example, the expression (x)–y could be either interpreted as a cast expression (a cast of –y to type x) or as an additive expression combined with a parenthesized expression, which computes the value x – y.
For more information on method invocation, see Methods (C# Programming Guide).
For more information, see the following sections in the C# Language Specification: