Reputation: 75
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.
Upvotes: 5
Views: 4851
Reputation: 451
Variables in all capital letters in any language generally refer to constants, meaning the value should never change.
In this case, they could refer to an enumerated type, which is a special sort of constant basically is just a symbol for itself.
Upvotes: 3
Reputation: 6683
They are private constants. You can tell by the icon next to their name. Take a look at the constant TEST in this example...
EDIT: The all caps is merely by convention, but is usually used to represent constants.
Upvotes: 6