Exam-style question
Try this first
What will happen if you try to change the value of a constant?.
- A.The program will run successfully
- B.A compilation error will occur
- C.The constant will change value
- D.Nothing will happen
Answer and explanation
Concise answer
A compilation error will occur
Why this is correct
Constants are designed to prevent changes, and attempting to do so results in an error.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
