Desc

Páginas: 19 (4721 palabras) Publicado: 3 de marzo de 2013
Java
Code Conventions
September 12, 1997ii
Please
Recycle
Copyright Information
 1997, SunMicrosystems, Inc. All rights reserved.
2550 Garcia Avenue,Mountain View, California 94043-1100 U.S.A.
This document is protected by copyright.No part of this documentmay be reproduced in any formby anymeans
without priorwritten authorization of Sun and its licensors, if any.
The informationdescribed in this documentmay be protected by one ormore U.S. patents, foreign patents, or
pending applications.
TRADEMARKS
Sun, SunMicrosystems, SunMicroelectronics, the Sun Logo, SunXTL, JavaSoft, JavaOS, the JavaSoft Logo, Java,
HotJava Views,HotJJavaChips, picoJava,microJava, UltraJava, JDBC, the Java Cup and SteamLogo, “WriteOnce,
Run Anywhere” and Solaris are trademarks or registeredtrademarks of SunMicrosystems, Inc. in the United States
and other countries.
UNIX® is a registered trademark in the United States and other countries, exclusively licensed through X/Open
Company, Ltd.
Adobe ® is a registered trademark of Adobe Systems, Inc.
NetscapeNavigator™ is a trademark ofNetscape Communications Corporation.
All other product namesmentioned herein are the trademarks of theirrespective owners.
THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS.
CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BEINCORPORATED IN NEW EDITIONS OF THE DOCUMENT. SUN MICROSYSTEMS, INC. MAY MAKE
IMPROVEMENTSAND/OR CHANGES INTHE PRODUCT(S)AND/OR THE PROGRAM(S)DESCRIBEDINTHIS
DOCUMENT AT ANY TIME.June 2, 1997
iii
1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Why Have Code Conventions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 1
1.2 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 File Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2.1 File Suffixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 Common File Names . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . 2
3 File Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3.1 Java Source Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3.1.1 Beginning Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.1.2 Package and ImportStatements . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.1.3 Class and Interface Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4 Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.1 Line Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.2 Wrapping Lines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
5 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5.1 Implementation Comment Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5.1.1 Block Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65.1.2 Single-Line Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.1.3 Trailing Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.1.4 End-Of-Line Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.2 Documentation Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Que son las desc
  • desca
  • DESC
  • desc.
  • Desc
  • Desc
  • descan
  • DESC

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS