这句话有什么道理? (Sun对Java变量的命名约定) [英] How is this statement making sense? (Sun's naming convention for Java variables)

查看:87
本文介绍了这句话有什么道理? (Sun对Java变量的命名约定)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几天,我一直在引用Sun的文档中的这一部分,直到现在我才停下来思考一下它在说什么,我对此一无所知.请记住,英语不是我的母语.

I've been quoting this segment from Sun's document for the past few days, and only now do I stop and think about what it's saying, and I can't make any sense of it. Please keep in mind that English is not my first language.

变量:除变量外,所有实例,类和类常量在大小写混合的情况下均带有小写首字母.

这有什么道理?这不是说类名是大小写混合的首字母吗?就像我应该将其命名为class myClass吗?而且类常量也与小写的首字母混合使用吗?像是代替Integer.MAX_VALUE一样,应该将其命名为integer.maxValue?

How is this making sense? Isn't this saying that class names are in mixed case with a lower-case first letter? Like I should name it class myClass? And class constants are also in mixed case with a lower-case first letter? Like instead of Integer.MAX_VALUE, it should've been named integer.maxValue?

这真的是在说变量本身应该如何命名吗?

And is it really saying anything about how variables themselves should be named?

我无法正确解析吗,或者这实际上是公然的错误吗?

Am I not parsing this properly or is this actually a blatant error?

推荐答案

Sun已将其作为 bug 接受,但优先级较低:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id= 4311597

Sun has accepted this as a bug, with low priority:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4311597

描述变量命名约定(表中倒数第二行).这是完全错误的-阶级 常量不是混合使用的,如表中的下一行所示.这是什么除了变量" 商业?文字应该是来描述变量!

describing the convention for naming variables (the penultimate row in the table). It is plainly wrong - class constants are not in mixed case, as the next row in the table shows. And what is this "except for variables" business? The text is supposed to be describing variables!!

文字应为:

所有实例变量和类变量混合在一起..."

"All instance and class variables are in mixed..."

因此删除变量除外"和类常量"一词

thus dropping the words "except for variables" and "class constants"

这篇关于这句话有什么道理? (Sun对Java变量的命名约定)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆