Bala S
What is the importance of using Const keyword in C#
By Bala S in .NET on Jul 25 2018
  • Sreekanth Reddy
    Oct, 2018 26

    Const Value will NEVER gets changed.

    • 3
  • Vikas Agarwal
    Oct, 2018 18

    const is by default static and never change value throughout the application. We can access const entity via class name like ClassA.constVariableName

    • 1
  • Bala S
    Jul, 2018 25

    Const keyword for making entity as constant, cannot modify the value later in the code.

    • 1
  • Mamta Kalra
    Jan, 2021 19

    If we declare any variable to const type these variable value not change in life cycle of program

    • 0
  • Gaurav Gupta
    Apr, 2019 24

    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.

    • 0
  • Md Sarfaraj
    Jan, 2019 25

    The variable is fixed

    • 0
  • Siddhesh Chalke
    Oct, 2018 29

    Const keyword will restrict developers from changing variable value

    • 0
  • Pappu Kumar
    Oct, 2018 4

    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).

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS