Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

As question states, I am doing homework which have 2 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 rectangle with equal sign on it and a lock declaring it private.

This is a picture of class diagram.

Regards.

like image 366
speedwie Avatar asked Nov 08 '11 04:11

speedwie


People also ask

Can variable be in capital letters?

Variable names that consist of a single character may be uppercase. In general, even single-character variable names should be lowercase. However, in some situations, mathematical notation uses uppercase letters. In such situations, uppercase variable names may be used.

Can a variable be in capital letters in C?

A variable name can only have letters (both uppercase and lowercase letters), digits and underscore. The first letter of a variable should be either a letter or an underscore.

What variable type should be declared for Capitalised?

The String type is capitalized because it is a class, like Object , not a primitive type like boolean or int (the other types you probably ran across).

Can variables be capital letters in Python?

Officially, variable names in Python can be any length and can consist of uppercase and lowercase letters ( A-Z , a-z ), digits ( 0-9 ), and the underscore character ( _ ).


1 Answers

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.

like image 168
Stefan H Avatar answered Sep 22 '22 11:09

Stefan H