有Java的编码标准吗? [英] Is there a coding standard for Java?

查看:121
本文介绍了有Java的编码标准吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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



感谢您的预订。

解决方案

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



为此,我可以推荐为旧的帖子



Macarse 说:


你读过Effective Java吗?
http://java.sun.com/docs/books/effective/




it中有很多好的代码。



b $ b

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


你可以随时检查jdk源代码
,有一些好的algorythms

http://java.sun.com/j2se/1.5.0/source_license.html



此外,有时我使用研究一些
好​​的开源应用程序代码...



编辑:也是一个好主意,
参加像
这样的社区。

查看: http://www.javadb.com/


Naiku 说:


最好的选择学习好的
代码是看一些流行的开放
源项目。我认为2年是
足够好的时间来理解
这些项目中的代码。一些项目
你可以看看:

  * openjdk 
* apache tomcat
* spring框架
* apache commons(非常有用)
* Google collections

足够你学习和了解一个
各种概念。我经常
在JDK catalina(tomcat)和
spring,jboss等学习代码。


a href =http://stackoverflow.com/questions/627784/what-are-some-java-memory-management-best-practices> Java内存管理 ,请参阅此< a href =http://stackoverflow.com/questions/627784/what-are-some-java-memory-management-best-practices> 问题


I can develop an application/project. But that is not in the correct coding standard. it takes large memory and others can not be understand it easily. What the General Standard to for coding. I have a question like how to name the variables methods & what is the best way to package the classes. like that?

For that, is there any tutorial or example please share .

Thanks in Advance.

解决方案

What you need are the best-practices (JAVA) and how it works.

For that, i can recommend as an older post

as Macarse said:

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

There is a good amount of good code in it.

To learn how things are done (in the best way) i'll recommend to always check other people's code, especially the open source projects.

You can always check the jdk source code, there are some good algorythms 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/

as Naiku said:

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 study and understand a variety of concepts. I frequently study code in JDK catalina(tomcat) and spring, jboss, etc.

For Java Memory Management see this Question

这篇关于有Java的编码标准吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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