1/3/2019 2:04:17 PM
No, you can't use var while defining the constant.
You should use any of other data-type while defining constant.
Otherwise, you can use var too.
const (C# Reference)
Yes thank, I understand now .var keyword can chage but other data type will be used in constant declartion
Yes,thank ."const" is keyword?
While we define constant, it is not required to be double.
You can surely change data-type of constat variable.
I made a simple example where I defined constat with 4 different data-types.
you want to declare a constant variable so use const keyword instead of var keyword
because the value assigned to constant cannot be changed,
Learn Playing. Play Learning
Send us a message