Jump to: navigation, search

C Sharp Variables and Constants

302 bytes added, 16:44, 11 January 2008
What is a C# Constant?
const int interestRate = 10;
Note that a constant, unlike a variable, must be initialized at the point that it is declared. For example, the follwoing code:
const int interestRate;
will result in a compilation error along the lines of ''A const field requires a value to be provided''.

Navigation menu