Search code examples
c#coding-stylenaming-conventions

What could be the meaning of a variable in all capital letters?


I am doing homework that has two variables, BOOK and MAGAZINE, in all capital letters, and I can not figure out what could be the purpose of it.

Anyone have a clue?

The icon in Visio Class Diagram looks like a rectangle with an equal sign on it and a lock declaring it as private.

Regards.


Solution

  • They are private constants. You can tell by the icon next to their name. Take a look at the constant TEST in this example...

    Screen shot of private const in C# with intelisense

    EDIT: The all caps is merely by convention, but is usually used to represent constants.