[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-700988-105":3,"detail-sidebar-cat-0-en-105":84,"doc-detail-700988-en":134,"doc-similar-700988":165},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":77,"head_meta":79,"extra_data":81,"updated_unix":83},105,"en","java-code-conventions-1997-09-12-copyright-and-code-style-guidelines","Java Code Conventions - 1997-09-12 - Copyright and code style guidelines","","Java Code Conventions lays out style and documentation rules for Java source code, covering rationale for adopting conventions, file naming and organization, indentation, line length and wrapping, comment formats, declarations, and statement structure. It specifies how to place beginning comments and organize packages/imports, and defines guidance for whitespace, blank lines and spaces, naming conventions, and programming practices such as access to variables, constants, assignments, and key expression/conditional usage.",{"@graph":14,"@context":76},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/java-code-conventions-1997-09-12-copyright-and-code-style-guidelines/700988/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/java-code-conventions-1997-09-12-copyright-and-code-style-guidelines/700988.png","ImageObject",300,407,{"name":42,"@type":43},"Boyslovefans","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-21","2026-11-12",true,{"@type":52,"interactionType":53,"userInteractionCount":33},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68,72],{"name":59,"@type":60,"acceptedAnswer":61},"Why does the document emphasize having Java code conventions?","Question",{"text":62,"@type":63},"It explains that software maintenance dominates lifetime cost, most code is maintained by others, and conventions improve readability so engineers can understand code faster and more thoroughly.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"Which areas are covered for formatting and readability?",{"text":67,"@type":63},"The document includes indentation rules (line length and wrapping), whitespace (blank lines and spaces), and naming conventions to keep code consistent and easier to read.",{"name":69,"@type":60,"acceptedAnswer":70},"What comment standards does the document define?",{"text":71,"@type":63},"It distinguishes implementation comment formats (block, single-line, trailing, and end-of-line) and documentation comments, specifying how to structure and apply them in source code.",{"name":73,"@type":60,"acceptedAnswer":74},"What programming practices are addressed beyond formatting?",{"text":75,"@type":63},"It covers guidance for access to instance/class variables, referring to class variables and methods, constants, variable assignments, and miscellaneous practices like parentheses, returning values, conditional operator expression placement, and special comments.","https://schema.org",{"og:url":32,"og:type":78,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":80,"canonical":32},"index,follow",{"doc_id":82,"site_id":7},700988,1794522632,{"code":4,"msg":85,"data":86},"success",[87,91,95,99,104,108,113,118,123,126,130],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":96,"show_sort_weight":97,"slug":98},"Exam",70,"exam",{"id":100,"doc_module":4,"doc_module_name":25,"category_name":101,"show_sort_weight":102,"slug":103},5,"Comic",60,"comic",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":106,"slug":107},6,50,"technology",{"id":109,"doc_module":4,"doc_module_name":25,"category_name":110,"show_sort_weight":111,"slug":112},7,"Healthcare",40,"healthcare",{"id":114,"doc_module":4,"doc_module_name":25,"category_name":115,"show_sort_weight":116,"slug":117},8,"Research & Report",30,"research-report",{"id":119,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":121,"slug":122},9,"Religion & Spirituality",20,"religion-spirituality",{"id":121,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":121,"slug":125},"World Cup","world-cup",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":127,"slug":129},10,"Lifestyle","lifestyle",{"id":131,"doc_module":4,"doc_module_name":25,"category_name":132,"show_sort_weight":100,"slug":133},19,"General","general",{"code":4,"msg":85,"data":135},{"doc_id":82,"user_id":136,"nickname":42,"user_avatar":137,"doc_module":4,"category_id":105,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":138,"file_id":139,"file_url":140,"file_type":141,"file_size":142,"view_count":33,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":143,"language":144,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":145,"faqs":146,"seo_title":147,"seo_description":12,"update_tm":83,"read_time":102,"preview_page_count":33,"preview_urls":148},1374410101428,"https://ap-avatar.wpscdn.com/davatar_3d24733baf745e90a7e4bdd5f77d97b2","Java Code Conventions  \nSeptember 12, 1997  \nCopyright Information  \n􀀁 1997, Sun Microsystems, Inc. All rights reserved.  \n2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A.  \nThis document is protected by copyright. No part of this document maybe reproduced in any form by any means without prior written authorization of Sun and its licensors, if any.  \nThe information described in this document maybe protected by one or more U.S. patents, foreign patents, or pending applications.  \nTRADEMARKS  \nSun, 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 of Sun Microsystems, Inc. in the United States and other countries.  \nUNIX ® is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd.  \nAdobe ® is a registered trademark of Adobe Systems, Inc.  \nNetscape Navigator™ is a trademark of Netscape Communications Corporation.  \nAll other product names mentioned herein are the trademarksoftheir respective owners.  \nTHIS 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.  \nTHIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE DOCUMENT. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/ORTHE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME.  \nPlease Recycle  \nJune 2, 1997  \n1 Introduction............................................ 1  \n1.1 Why Have Code Conventions.................................... 1  \n1.2 Acknowledgments ............................................ 1  \n2 File Names ............................................. 1  \n2.1 File Sufﬁxes ................................................. 2  \n2.2 Common File Names .......................................... 2  \n3 File Organization ....................................... 2  \n3.1 Java Source Files ............................................. 2  \n3.1.1 Beginning Comments ................................... 3  \n3.1.2 Package and Import Statements ........................... 3  \n3.1.3 Class and Interface Declarations .......................... 3  \n4 Indentation ............................................ 4  \n4.1 Line Length ................................................. 4  \n4.2 Wrapping Lines .............................................. 4  \n5 Comments ............................................. 6  \n5.1 Implementation Comment Formats ............................... 6  \n5.1.1 Block Comments ...................................... 6  \n5.1.2 Single-Line Comments ................................. 7  \n5.1.3 Trailing Comments..................................... 7  \n5.1.4 End-Of-Line Comments................................. 7  \n5.2 Documentation Comments ...................................... 8  \n6 Declarations ............................................ 9  \n6.1 Number Per Line ............................................. 9  \n6.2 Placement ................................................... 9  \n6.3 Initialization ................................................ 10  \n6.4 Class and Interface Declarations ................................ 10  \n7 Statements ............................................ 10  \n7.1 Simple Statements ........................................... 10  \n7.2 Compound Statements ........................................ 11  \n7.3 return Statements ............................................ 11  \n7.4 if, if-else, if-else-if-else Statements .............................. 11  \n7.5 for Statements ............................................... 1","cbCaicJAYXQG7rWz","https://ap.wps.com/l/cbCaicJAYXQG7rWz","pdf",131988,24,"English","# Introduction\n## Why Have Code Conventions\n## Acknowledgments\n# File Names\n## File Sufﬁxes\n## Common File Names\n# File Organization\n## Java Source Files\n### Beginning Comments\n### Package and Import Statements\n### Class and Interface Declarations\n# Indentation\n## Line Length\n## Wrapping Lines\n# Comments\n## Implementation Comment Formats\n### Block Comments\n### Single-Line Comments\n### Trailing Comments\n### End-Of-Line Comments\n## Documentation Comments\n# Declarations\n## Number Per Line\n## Placement\n## Initialization\n## Class and Interface Declarations\n# Statements\n## Simple Statements\n## Compound Statements\n## return Statements\n## if, if-else, if-else-if-else Statements\n## for Statements\n## while Statements\n## do-while Statements\n## switch Statements\n## try-catch Statements\n# White Space\n## Blank Lines\n## Blank Spaces\n# Naming Conventions\n# Programming Practices\n## Providing Access to Instance and Class Variables\n## Referring to Class Variables and Methods\n## Constants\n## Variable Assignments\n## Miscellaneous Practices\n### Parentheses\n### Returning Values\n### Expressions before ‘?’ in the Conditional Operator\n### Special Comments\n# Code Examples\n## Java Source File Example","[{\"question\":\"Why does the document emphasize having Java code conventions?\",\"answer\":\"It explains that software maintenance dominates lifetime cost, most code is maintained by others, and conventions improve readability so engineers can understand code faster and more thoroughly.\"},{\"question\":\"Which areas are covered for formatting and readability?\",\"answer\":\"The document includes indentation rules (line length and wrapping), whitespace (blank lines and spaces), and naming conventions to keep code consistent and easier to read.\"},{\"question\":\"What comment standards does the document define?\",\"answer\":\"It distinguishes implementation comment formats (block, single-line, trailing, and end-of-line) and documentation comments, specifying how to structure and apply them in source code.\"},{\"question\":\"What programming practices are addressed beyond formatting?\",\"answer\":\"It covers guidance for access to instance/class variables, referring to class variables and methods, constants, variable assignments, and miscellaneous practices like parentheses, returning values, conditional operator expression placement, and special comments.\"}]","Java Code Conventions - 1997-09-12 - Copyright and code style guidelines | PDF",[149,153,157,161],{"page_no":22,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/c89ba77a1cdd4d6568787c1377d7429a.webp",983,1272,{"page_no":26,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/465e90da501c4df8df2225456bd2f171.webp",982,1270,{"page_no":30,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/bfa1272fd54f2d77370809a14218aef5.webp",981,1269,{"page_no":33,"url":162,"width":163,"height":164},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/918361c206443a7ee1ee6f2d9b3cc8c1.webp",980,1268,{"list":166,"token":11},[167,173,179,185,191,197,204,210,216,222],{"doc_id":168,"doc_title":169,"file_type":141,"home_preview_img_url":170,"slug":171,"view_count":109,"category_name":29,"create_tm":172},692314,"CS 116 Course Specific Style Guide - Document","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003205286/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=ZtsqQNnRKvZuhL7PUmGwoA8zR9Q%3D","cs-116-course-specific-style-guide-document",1794193120,{"doc_id":174,"doc_title":175,"file_type":141,"home_preview_img_url":176,"slug":177,"view_count":30,"category_name":29,"create_tm":178},682216,"Python Code Style Guide - Introduction - Format and use of White Space","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999427657/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=yz7rARV1sFFQuN6LQQMPpi4ISRA%3D","python-code-style-guide-introduction-format-and-use-of-white-space",1793963005,{"doc_id":180,"doc_title":181,"file_type":141,"home_preview_img_url":182,"slug":183,"view_count":33,"category_name":29,"create_tm":184},693076,"ROS C++ STYLE GUIDE - Version 1 - style guide instructions","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230004260684/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=AViED2mT8YT07j1x0fCEr4W64SQ%3D","ros-c-style-guide-version-1-style-guide-instructions",1794248313,{"doc_id":186,"doc_title":187,"file_type":141,"home_preview_img_url":188,"slug":189,"view_count":33,"category_name":29,"create_tm":190},682217,"A Python Style Guide - Draft","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998448576/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=sSOayOxiUrfjfG8M8klIWpmCkME%3D","a-python-style-guide-draft",1793963006,{"doc_id":192,"doc_title":193,"file_type":141,"home_preview_img_url":194,"slug":195,"view_count":30,"category_name":29,"create_tm":196},685690,"LEC 02 - ArrayList - Lecture Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000179321/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=0uoKUQowwwTRJFY8l3SAfJgAwM0%3D","lec-02-arraylist-lecture-notes",1794016767,{"doc_id":198,"doc_title":199,"file_type":141,"home_preview_img_url":200,"slug":201,"view_count":202,"category_name":29,"create_tm":203},137735,"The Java Language Specification - Java SE 8 Edition - Final Release","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229863392130/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=IsT3%2FP1wX1trJxGbhpBwSgYDKnM%3D","the-java-language-specification-java-se-8-edition-final-release",23,1787439727,{"doc_id":205,"doc_title":206,"file_type":141,"home_preview_img_url":207,"slug":208,"view_count":105,"category_name":29,"create_tm":209},672869,"Google HTML/CSS Style Guide - Formatting and style rules","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229989673248/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=zQWj7YNxtpYEeRz8MC%2BMsu0vulI%3D","google-htmlcss-style-guide-formatting-and-style-rules",1793611799,{"doc_id":211,"doc_title":212,"file_type":141,"home_preview_img_url":213,"slug":214,"view_count":105,"category_name":29,"create_tm":215},672868,"Google's R Style Guide - Coding Style Rules","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229990161141/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=z3VrUvJ6f9fkQIPNfvGOIbxRG6k%3D","googles-r-style-guide-coding-style-rules",1793611796,{"doc_id":217,"doc_title":218,"file_type":141,"home_preview_img_url":219,"slug":220,"view_count":105,"category_name":29,"create_tm":221},682223,"Python PEP8 style guide - Cheat Sheet - Naming conventions - Maximum Line Length and Line Breaking - Indentation - Comments - Code Layout","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999427735/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=W%2BQFvNaLdyb1dyZy9TM%2B%2Bzvp2zA%3D","python-pep8-style-guide-cheat-sheet-naming-conventions-maximum-line-length-and-line-breaking-indentation-comments-code-layout",1793963021,{"doc_id":223,"doc_title":224,"file_type":141,"home_preview_img_url":225,"slug":226,"view_count":105,"category_name":29,"create_tm":227},682220,"Style Guide for CS 231 and CS 234 - Python Style Requirements","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998448640/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=WwG4cB69J749T7vPspH0B5Rs7JM%3D","style-guide-for-cs-231-and-cs-234-python-style-requirements",1793963013]