What is a constant in C# ?
Constants in C# are immutable values whose value must be know to compiler during compilation time and must not be changed through out the program life time.
Constants in C# are mutable values whose value can be changed in constructors.
Constants in C# are immutable values whose values are assigned in constructors.
None of the above.
Constants in C# are immutable values whose value should be known to the compiler compile time and do not change for the life of the program. Constants are declared using the const keyword. Constants must be initialized during the time of declaration only.
public class A
public const float PI=3.174f ;
Back To Top