Current .Net Version: 1.1.4322
Home
Articles
Practice C# Online
C# Reference
XML Web Services
RSS Feeds
T-SQL Scripts
Videos
Valuable Links
Contact Us
Mike's C#, VS.NET and SQL Blog
ROR XML Info.
C# Reference
The world's largest C# Language & Framework Class Library Reference Database (second only to Microsoft's)!
Language Reference:
Language Search:
Framework Class Library Reference:
Framework Class Library Search:

const
Is a:Modifier Keyword
Applies to Version:C# 1.0 and later
Namespace:N/A
Assembly:N/A (N/A)
Description:Declares a filed or variable as being read-only (cannot be modified outside of its declaration in code). A constant cannot be defined with the static modifier. The value being assigned to a constant must also be constant.
Example(s):public const String Greeting = "Hello World!"; // the following will give you an error because it is not a literal (constant) value: public const DateTime CurrentDateTime = DateTime.Now;
 
COPYRIGHT/DISCLAIMER | CONTACT US