Constants Flashcards
USER_NAME
Is this the name of a constant?
USER_NAME
Yes, this is a constant. It is named using the UPPERCASE naming convention.
nameOfPlayer
Is this the name of a constant?
nameOfPlayer
No, this is a variable, named using the camelCase naming convention.
numberOfOrcs
Is this the name of a constant?
No. This is a variable, named using the camelCase naming convention.
NUMBER_OF_EMPLOYEES
Is this the name of a constant?
NUMBER_OF_EMPLOYEES
Yes, this is a constant. It is named using the UPPERCASE naming convention.
PLAYER_NAME
Is this the name of a constant?
PLAYER_NAME
Yes, this is a constant. It is named using the UPPERCASE naming convention.
PLAYER-NAME
Is this the name of a constant?
PLAYER-NAME
No, this is not a constant. The hyphen is not used in naming constants. It should be named PLAYER_NAME with an underscore.
PLAYER NAME
Is this the name of a constant?
No. This is either two constants, or it is one constant missing an underscore. It should be: PLAYER_NAME
DEFAULT_RATE
Is this the name of a constant?
DEFAULT_RATE
Yes, this is a constant. It is named using the UPPERCASE naming convention.
MPG
Is this the name of a constant?
MPG
Yes, this is a constant. It is named using the UPPERCASE naming convention.
country
Is this the name of a constant?
country
No, this is a variable named using the camelCase naming convention.
mySchool
Is this the name of a constant?
mySchool
No, this is a variable named using the camelCase naming convention.
aConstant
Is this the name of a constant?
aConstant
No, this is a variable named using the camelCase naming convention.
VARIABLE
Is this the name of a constant?
VARIABLE
Yes, this is a constant. It is named using the UPPERCASE naming convention. But it is poorly named and likely to cause confusion..
TEAM_NAME
Is this the name of a constant?
Yes, this is a constant. It is named using the UPPERCASE naming convention.
DOG_NAME
Is this the name of a constant?
Yes, this is a constant. It is named using the UPPERCASE naming convention.