Is there a coding standard for Java?

后端 未结 4 905
小鲜肉
小鲜肉 2021-01-20 22:56

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 Stan

4条回答
  •  一整个雨季
    2021-01-20 23:00

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

    I will recommend 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 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/

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

    For Java Memory Management see this Question

提交回复
热议问题