`
joyo_fly
  • 浏览: 87807 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
文章分类
社区版块
存档分类
最新评论

Code Conventions for the Java TM Programming Language

阅读更多

http://www.oracle.com/technetwork/java/codeconvtoc-136057.html

1 Introduction

1.1 Why Have Code Conventions
1.2 Acknowledgments

2 File Names
2.1 File Suffixes
2.2 Common File Names

3 File Organization
3.1 Java Source Files
3.1.1 Beginning Comments
3.1.2 Package and Import Statements
3.1.3 Class and Interface Declarations

4 Indentation
4.1 Line Length
4.2 Wrapping Lines

5 Comments
5.1 Implementation Comment Formats
5.1.1 Block Comments
5.1.2 Single-Line Comments
5.1.3 Trailing Comments
5.1.4 End-Of-Line Comments
5.2 Documentation Comments

6 Declarations
6.1 Number Per Line
6.2 Initialization
6.3 Placement
6.4 Class and Interface Declarations

7 Statements
7.1 Simple Statements
7.2 Compound Statements
7.3 return Statements
7.4 if, if-else, if else-if else Statements
7.5 for Statements
7.6 while Statements
7.7 do-while Statements
7.8 switch Statements
7.9 try-catch Statements

8 White Space
8.1 Blank Lines
8.2 Blank Spaces

9 Naming Conventions

10 Programming Practices
10.1 Providing Access to Instance and Class Variables
10.2 Referring to Class Variables and Methods
10.3 Constants
10.4 Variable Assignments
10.5 Miscellaneous Practices
10.5.1 Parentheses
10.5.2 Returning Values
10.5.3 Expressions before `?' in the Conditional Operator
10.5.4 Special Comments

11 Code Examples
11.1 Java Source File Example

 

分享到:
评论

相关推荐

    Code Conventions for the JavaScript Programming Language

    3. **避免不必要的属性**:无需在`<script>`标签中使用`language`或`type`属性,因为这些属性是由服务器而非标签本身来确定MIME类型。 #### 三、缩进 1. **标准单位**:统一采用4个空格作为缩进单位,避免使用制表...

    Java语言编码规范 (Java Code Conventions)

    Java 语言编码规范(Java Code Conventions) Java 语言编码规范是 Java 语言的编码标准,旨在提高软件的可读性、可维护性和可扩展性。该规范涵盖了文件组织、命名规范、缩进排版、注释、声明、语句、空白、编程...

    The C programming Language(chm格式完整版)

    The C programming Language By Brian W. Kernighan and Dennis M. Ritchie. Published by Prentice-Hall in 1988 ISBN 0-13-110362-8 (paperback) ISBN 0-13-110370-9 目录结构: Contents Preface Preface ...

    Java语言编码规范(Java Code Conventions) txt版

    #### 1.1 为何需要编码规范(Why Have Code Conventions) 为了保证代码的质量和一致性,编码规范是必不可少的。其原因包括: - **维护效率**:大多数软件系统都需要长期的维护和支持。良好的编码规范可以大大提高...

    Java语言编码规范(Java Code Conventions)

    Java语言编码规范,也被称为Java Code Conventions,是Java开发者遵循的一套标准和最佳实践,旨在提高代码的可读性、可维护性和团队协作效率。这些规范覆盖了命名规则、代码布局、注释、错误处理等多个方面,是每个...

    阿里idea代码格式化文件Aliyun Code Conventions.xml

    idea阿里代码格式化文件Aliyun Code Conventions.xml,通过idea->editor->scheme中的 Import Scheme-> IntelliJ IDEA code style XML导入

    GoogleJava Style

    This document serves as the complete definition of Google's coding standards for source code in the Java™ Programming Language. A Java source file is described as being in Google Style if and only if...

    C++ 2x Working Draft, Standard for Programming Language C ++

    《C++ 2x Working Draft, Standard for Programming Language C++》是C++编程语言的一份工作草案,旨在规范和定义C++的实现要求。这份文档不仅明确了C++语言的实现必须遵循的规定,还包含了对语言本身的详细定义。...

    java编程风格 编程规范 The Java Language Specification the elements of java style

    总共包含了三个pdf资源(都为英文):java编程规范第三版(The Java Language Specification);java编程风格(the elements of java style);sun的Java code conventions

    The C programming Language

    The C programming Language.chm <br>The C programming Language By Brian W. Kernighan and Dennis M. Ritchie. Published by Prentice-Hall in 1988 <br>ISBN 0-13-110362-8 (paperback) ISBN 0...

    C Programming - Just the FAQS

    regarding the conventions, keywords, and terms used with the C language. This chapter attempts to answer some of the most frequently asked questions regarding these subjects. For instance, one of the ...

    Java and Algorithmic Thinking for the Complete Beginner – Compact Edition

    This book is for anyone ... teachers, professors, novices or average programmers, or for anyone who wants to start learning or teaching computer programming using the proper conventions and techniques.

    Safe-Programming-for-JAVA.rar_java programming

    10. **编程规范**:遵循Java编程规范,如Sun Microsystems发布的Java Code Conventions,可以提高代码的可读性,并减少因命名不规范、缩进混乱等问题导致的误解。 以上所述只是"Safe Programming for JAVA.rar"可能...

    CodeConventions.pdf

    《Java编码规范》 在软件开发领域,代码规范起着至关重要的作用。这份1997年9月12日发布的《Java编码规范》详细阐述了编写Java代码时应遵循的约定,旨在提高代码的可读性和维护性,降低软件生命周期中的维护成本,...

    The Java EE 6 Tutorial Basic Concepts 4th Edition

    Chapter 17: Introduction to Contexts and Dependency Injection for the Java EE Platform 305 Overview of CDI 306 About Beans 307 About Managed Beans 307 Beans as Injectable Objects 308 Using ...

    各种编程语言编码规范大全

    不同编程语言有自己的最佳实践和社区约定,例如Python有PEP 8,Java有Oracle的Java Code Conventions,JavaScript有Airbnb的JavaScript Style Guide等。这些规范覆盖了语言特性的使用、代码格式化、模块结构、测试...

Global site tag (gtag.js) - Google Analytics