Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
462 CHAPTER 17: CLASSES A constant declaration that declares multiple constants is equivalent to multiple declarations of single constants with the same attributes, modifiers, and type. [Example: 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] Constants are permitted to depend on other constants within the same program as long as the dependencies are not of a circular nature. The compiler automatically arranges to evaluate the constant declarations in the appropriate order. [Example: In the following code class A { public const int X = B.Z + 1; public const int Y = 10; } class B {