Constants in C#.Net

InfoPath alternatives for form designing SharePoint

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

You can also check out Constructor and Destructors in C#.Net, Common Language Runtime in C#.Net and 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.

Similar SharePoint 2013 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 →

Leave a Reply