全部大写字母的变量的含义是什么?
我正在做的作业有两个变量,书和杂志,全部都是大写字母,我不知道它的目的是什么。
有人知道吗?
Visio 类图中的图标看起来像一个矩形,上面有一个等号和一个声明其为私有的锁。
问候。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它们是私有常量。您可以通过他们名字旁边的图标来判断。看看这个例子中的常量 TEST...
编辑:
全部大写只是按照惯例,但通常用于表示常量。
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.
任何语言中全部大写字母的变量通常指的是常量,这意味着值永远不会改变。
在这种情况下,它们可以引用枚举类型,这是一种特殊的常量,基本上只是其本身的符号。
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.