class A { public const double X = 1.0, Y = 2.0, Z = 3.0; }is equivalent to
class A { public const double X = 1.0; public const double Y = 2.0; public const double Z = 3.0; }end example] Paragraph 101 Constants are permitted to depend on other constants within the same program as long as the dependencies are not of a circular nature. 2 The compiler automatically arranges to evaluate the constant declarations in the appropriate order. [Example: In the example
class A { public const int X = B.Z + 1; public const int Y = 10; } class B { public const int Z = A.Y + 1; }the compiler first evaluates A.Y, then evaluates B.Z, and finally evaluates A.X, producing the values 10, 11, and 12. end example] 3 Constant declarations may depend on constants from other programs, but such dependencies are only possible in one direction. [Example: Referring to the example above, if A and B were declared in separate programs, it would be possible for A.X to depend on B.Z, but B.Z could then not simultaneously depend on A.Y. end example]
| |
Jagger Software Ltd | |
Company # 4070126 | |
VAT # 762 5213 42 |