- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
You cannot change the value of an object when it is defined using const keyword.
After changing it will remain same.
Let’s say the following is our variable defined with const −
Following is the code to change the const variable, which would only display the initial value −
To run the above program, you need to use the following command −
Here, my file name is demo225.js.
The output is as follows −
- Can a C++ variable be both const and volatile?
- Is name a reserved word in MySQL?
- Select into a user-defined variable with MySQL
- How can we store a value in user-defined variable?
- Can we use reserved word ‘index’ as MySQL column name?
- MySQL ORDER BY with numeric user-defined variable?
- How to modify a const variable in C?
- How Can we permanently define user-defined variable for a client in MySQL?
- How to initialize const member variable in a C++ class?
- Program to find out the total number of characters to be changed to fix a misspelled word in Python
- In MySQL, why a client cannot use a user-defined variable defined by another client?