amir peretz

amir peretz

  • NA
  • 1
  • 0

Constants in C#

Jul 31 2006 12:08 AM

Hi everybody,

 

I would like to know what is the “right way” to use constants in C#

 

I need to define relatively large number of constant values that need to be accessible from throughout the application.

 

Should I just create a class that will have all the definitions as “public const…”, and every class that will need to use this value will just create this object?

 

Is there any better way to do it? Does C# provide any built-in mechanism to do so?

 

thanks


Answers (2)