Tarea

Páginas: 19 (4728 palabras) Publicado: 6 de junio de 2012
Java Code Conventions
September 12, 1997

Copyright Information  1997, Sun Microsystems, 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 document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. The information described in thisdocument may be protected by one or more U.S. patents, foreign patents, or pending applications.

TRADEMARKS Sun, Sun Microsystems, Sun Microelectronics, the Sun Logo, SunXTL, JavaSoft, JavaOS, the JavaSoft Logo, Java, HotJava Views, HotJJavaChips, picoJava, microJava, UltraJava, JDBC, the Java Cup and Steam Logo, “Write Once, Run Anywhere” and Solaris are trademarks or registered trademarks ofSun Microsystems, 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. Netscape Navigator™ is a trademark of Netscape Communications Corporation. All other product names mentioned herein are the trademarks of their respectiveowners.

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 BE INCORPORATEDIN NEW EDITIONS OF THE DOCUMENT. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME.

Please Recycle

ii

June 2, 1997

1

Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 1.2 Why Have Code Conventions. . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . 1 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2

File Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2.1 2.2 File Suffixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Common File Names . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

3

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

4

Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.1 4.2 Line Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 4 Wrapping Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

5

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
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. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Documentation Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Mi tarea Tu tarea
  • tarea tarea
  • Tarea Tarea
  • Tarea
  • Tarea
  • Tarea
  • Tarea
  • Tarea

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS