Книга: C# 2008 Programmer

Constants

Constants

To declare a constant in C#, you use the const keyword, like this:

//---declared the PI constant---
const float PI=3.14f;

You cannot change the value of a constant (during runtime) once it has been declared and assigned a value.

As a good programming practice, you should always use constants whenever you use values that do not change during runtime.

Оглавление статьи/книги

Генерация: 0.613. Запросов К БД/Cache: 2 / 0
поделиться
Вверх Вниз