Multiple choice .net

The name of a constant:

  1. must both begin with a letter and be all upper case.

  2. does not have to begin with a letter but must be all upper case.

  3. must begin with a letter but can be upper or lower case.

  4. does not have to begin with a letter and be either upper or lower case.

  5. None of the above.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Constant names follow the same naming rules as variables: they must begin with a letter and can be uppercase or lowercase. The convention is to use uppercase (MY_CONSTANT), but it's not a language requirement - it's a style convention.

AI explanation

In the language convention this question is based on, constant names follow the same basic identifier rules as variables — they don't have to start with a letter, and casing (upper or lower) isn't enforced by the language itself, even though all-caps is a common style convention. That's why the more permissive option is correct: capitalization and a leading letter are stylistic choices, not hard requirements.