Multiple choice .net

Which variable name uses a standard naming convention for module variables?

  1. mWeight

  2. mdWeight

  3. moduleWeight

  4. module_Weight

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

The standard Hungarian notation prefix for module-level variables is 'm' followed by the appropriate type prefix - so 'mWeight' follows the convention (m for module, no explicit type prefix shown). 'md' would suggest a different naming scheme, and spelling out 'module' violates the concise prefix principle of Hungarian notation.

AI explanation

The standard naming convention for module-level variables prefixes the name with a lowercase m followed by the variable's name in PascalCase, e.g. mWeight. This mirrors similar scope-prefix conventions (like g for globals) and distinguishes module variables at a glance from local variables or parameters, unlike the other candidates which either misuse the prefix (mdWeight) or spell the scope out in full instead of abbreviating it.