标准约定
标准约定是变量和方法标识符以小写字母开头吗?
Is it true that Standard convention is that variables and method identifiers start with a lower case letter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,这就是 Java 标准命名约定,也是公司/程序员使用的许多其他标准所使用的命名约定。以大写字母开头的名称通常用于类型,如类名称。
另外,请查看 Java 命名约定文档:http://www. oracle.com/technetwork/java/codeconventions-135099.html#367
Yes, that is the Java standard naming convention, and it's also a naming convention put into use by many other standards used by companies/coders out there. Names that begin with capitals are typically used for types, as in class names.
Also, check out the Java naming conventions documentation: http://www.oracle.com/technetwork/java/codeconventions-135099.html#367
是的。这是正确的。
Yes. That's correct.
您可以在源代码中自行查找。
Find out by yourself at the source.
这是公认的 Java 约定。
其他约定:
PackageName.ClassName.MethodName
,又名 Microsoft 风格(参见:.NET、Win32 API)namespace::class::some_static_method_name()
,又名 C++/STL/ C 风格(在大多数 C 代码库中也称为libraryname_function_name()
)schizo_PhrenicStylewhenyoucantKeep_things_working
- 不推荐。The is the accepted Java convention.
Other conventions:
PackageName.ClassName.MethodName
, aka Microsoft style (See: .NET, Win32 API)namespace::class::some_static_method_name()
, aka C++/STL/C style (also seen in most C code bases aslibraryname_function_name()
)schizo_PhrenicStylewhenyoucantKeep_things_working
- not recommended.