java - Java 有编码标准吗?

标签 java coding-style

我可以开发一个应用程序/项目。但这不是正确的编码标准。它需要很大的内存,其他人不容易理解。编码的通用标准是什么。我有一个问题,例如如何命名变量方法以及打包类的最佳方法是什么。像那样?

为此,是否有任何教程或示例请分享。

提前致谢。

最佳答案

您需要的是最佳实践 (JAVA) 及其工作原理。

我会推荐一个旧的post

作为Macarse说:

Have you read Effective Java? http://java.sun.com/docs/books/effective/

There is a good amount of good code in it.

要了解事情是如何完成的(以最好的方式),我会建议经常检查其他人的代码,尤其是开源项目。

You can always check the jdk source code, there are some good algorithms around it: http://java.sun.com/j2se/1.5.0/source_license.html

Also, sometimes I use to research some good open source apps code...

edited: Also is a good idea to participate in communities like this....

Check this out: http://www.javadb.com/

作为Naiku说:

The best option for you to study good code is to look at some popular open source projects. I think 2 years is good enough time to understand code in these projects. Some of the projects you could look at:

* openjdk
* apache tomcat
* spring framework
* apache commons (very useful)
* Google collections

Enough for you to study and understand a variety of concepts. I frequently study code in JDK catalina(tomcat), spring, jboss, etc.

对于 Java Memory Management看这个Question

关于java - Java 有编码标准吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3615348/

相关文章:

javascript - Ascii 标点字符到基本拉丁小写字母的映射

python - 我应该在函数调用的最后一个参数之后添加一个逗号吗?

java - GC 调优 - 防止 Full GC

java - 让 Jsoup 支持 JavaScript 动态生成的 html

java - 如何在Android中添加向firebase添加数据的进度对话框?

coding-style - 是否有任何样式指南建议或约定用于格式化复杂的 bool 逻辑?

c++ - 未知容器大小

c++ - 在 C++ 中迭代的优雅方式

java - struts2 on tomcat项目显示空白页,使用Fiddler显示404错误

java.sql.timestamp 与日期