Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Why to use keyword “const” in C#? Give an example.
Home
C Sharp
Why to use keyword “const” in C#? Give an example.
0
votes
asked
Oct 18, 2019
in
C Sharp
by
Robin
Why to use keyword “const” in C#? Give an example.
const-in-c#
c#-in-const
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Oct 18, 2019
by
rajeshsharma
“Const” keyword is used for making an entity constant. We can’t reassign the value to constant.
Eg: const string _name = "Test";
Related questions
0
votes
Q: Give an example of using sealed class in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
sealed-class-c#
c#-sealed-class
+1
vote
Q: What is Namespace in C#? Give example of in-built Namespace in .Net?
asked
Jan 20, 2020
in
C Sharp
by
AdilsonLima
0
votes
Q: Why to use lock statement in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
lock-statement
statement-in-c#
0
votes
Q: Why to use “Nullable Coalescing Operator” (??) in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
c#-nullable
nullable-in-c#
0
votes
Q: Why to use “finally” block in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
finally-c#
c#-finally
0
votes
Q: Why to use “using” in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
using-in-c#
c#-using
0
votes
Q: Which keyword is used for including the namespaces in the program in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment is a reserved keyword in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Which statment is a contextual keyword in C#?
asked
Jun 16, 2020
in
C Sharp
by
Hodge
#csharp
0
votes
Q: Explain “static” keyword in C#?
asked
Oct 18, 2019
in
C Sharp
by
Robin
static-c#
c#-static
...