Interviews8 answers
8 Answers
If we declare any variable to const type these variable value not change in life cycle of program
Mamta KalraPosted Jan 19, 2021, 1:05 PM EST
when we define variable as const it means the variable valve can't be changed in whole application. you must have to assign the value of declaration time otherwise it will give compile error.
Gaurav GuptaPosted Apr 24, 2019, 11:01 AM EDT
The variable is fixed
Md SarfarajPosted Jan 25, 2019, 5:09 AM EST
Const keyword will restrict developers from changing variable value
Siddhesh ChalkePosted Oct 29, 2018, 8:59 AM EDT
Const Value will NEVER gets changed.
Sreekanth ReddyPosted Oct 26, 2018, 4:01 AM EDT
const is by default static and never change value throughout the application. We can access const entity via class name like ClassA.constVariableName
Vikas AgarwalPosted Oct 18, 2018, 1:25 AM EDT
Constants in C# provide a named location in memory to store a data value. It means that the value of the variable will be known in compile time and will be stored in a single place. When you declare it, it is kind of 'hardcoded' in the Microsoft Intermediate Language (MSIL).
Pappu KumarPosted Oct 4, 2018, 2:22 AM EDT
Const keyword for making entity as constant, cannot modify the value later in the code.
Bala SPosted Jul 25, 2018, 9:24 AM EDT




