EnjoySharePoint YouTube Channel

Constants in C#.Net

In this article we will check what are constants in C#.Net.

Get Office 365 Enterprise E3 Or Business Premium Subscription & Try out all the features

You can also check out

Constructor and Destructors in C#.Net,

Common Language Runtime in C#.Net

Interfaces in C#.Net.

A constant is a variable whose value cannot be changed throughout its lifetime. We have to use const keyword to declare a constant like below:

const int number = 10;

some points to remember while working with constant:

– They must be initialized when they are declared; and after a value has been assigned, it can never be overwritten.

– The value of a constant must be computable at compile time. You can’t initialize a constant with a value taken from a variable. If you need to do this, you must use a read-only fi eld

– Constants are always implicitly static.

Check out Best Alternative to InfoPath -> Try Now
You May Also like the Following SharePoint Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →