Home  |  Contact us    
Cconstants in .Net


What is a constant?

A constant is a class member that represents a constant value: a value that can be computed at compile-time.

Constants are permitted to depend on other constants within the same program as long as there are no circular dependencies. The example


class Constants
{
 public const int A = 1;
 public const int B = A + 1;
}
shows a class named Constants that has two public constants

Category: Object Oriented Programming (OOPS) Concepts Faqs, Interview Questions & Answers



Ask New Questions
Microsoft.Net Framework
.Net 2.0 Namespaces
.Net Assemblies
OOPS Faqs in C#
ASP.Net Faqs
ASP.Net 2.0 Faqs
Web Services Faqs
ADO.Net Faqs
Database Faqs
OOPS Faqs
IT Project Management