⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 (3)

📁 java基础学习
💻
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Code Conventions for the Java Programming Language</title><meta name="description" content="This Code Conventions for the Java Programming Language document contains the standard conventions that we at Sun follow and recommend that others follow." /><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/><meta name="archiveFlag" content="false"/><link rel="stylesheet" href="/css/default_developer.css" /><script type='text/JavaScript' src='/js/popUp.js'></script></head><!--stopindex--><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" rightmargin="0" bgcolor="#ffffff"><a name="top"></a><!-- BEGIN MASTHEAD --><!-- BEGIN VNV1 MASTHEAD COMPONENT, thinner variation for content pages --><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%" height="25" class="topnav"><form name="formsearch" action="http://developer.sun.com/dispatcher.jsp" method="post"><tr><td><a href="#mast"><img src="http://developers.sun.com/im/a.gif" width="10" height="1" border="0" alt="Skip Masthead Links" /></a></td><td><a href="http://developers.sun.com">developers.sun.com</a></td><td width="100%">&nbsp;</td> <td nowrap="nowrap"><span class="rightarrowblue">&raquo;</span>&nbsp;<a href="http://developers.sun.com/dispatcher.jsp?uid=6910020">search tips</a>&nbsp;&nbsp;|&nbsp;&nbsp;<b>Search:</b>&nbsp;</td><td><input name="qt" class="medium" size="7" value="" /></td><td>&nbsp;</td><td class="selectcell"><select class="globalsearch" name="uid"><option value="6910018" selected>in Developers' Site</option><option value="6910019">in Sun.com</option></select></td><td>&nbsp;</td><td valign="middle" align="left"><input type="submit" border="0" class="buttonred" value="&nbsp;&raquo;&nbsp;" onmouseover="this.style.color='#fbe249';" onmouseout="this.style.color='#FFF';" /></td><td><img src="http://developers.sun.com/im/a.gif" width="10" height="1" alt=" " /></td></tr></form></table><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img src="http://developers.sun.com/im/a.gif" width="10" height="1" border="0" alt=" " /></td><td valign="top" class="grey3"><a href="http://java.sun.com"><img src="http://developers.sun.com/im/logo_java_grey.gif" width="180" height="53" border="0" alt=" " /></a></td><td><img src="http://developers.sun.com/im/a.gif" width="10" height="1" border="0" alt=" " /></td><td class="sunblue" valign="top" nowrap="nowrap"><div class="pad6"><a href="http://developers.sun.com"><img src="http://developers.sun.com/im/masthead_the_source.gif" width="262" height="25" border="0" alt="The Source for Developers" /></a><br /><a href="http://developers.sun.com/dispatcher.jsp?uid=6910022"><img src="http://developers.sun.com/im/masthead_sdn_site.gif" width="169" height="15" border="0" alt="A Sun Developer Network Site" /></a></div></td><td class="sunblue"><img src="http://developers.sun.com/im/a.gif" width="10" height="1" border="0" alt=" " /></td><td class="sunblue"><div class="pad6"><a href="http://developers.sun.com/dispatcher.jsp?uid=6910023"><img src="http://developers.sun.com/im/masthead_prod_and_tech.gif" width="158" height="15" border="0" alt="Products and Technologies" /></a><br /><a href="http://developers.sun.com/dispatcher.jsp?uid=6910024"><img src="http://developers.sun.com/im/masthead_tech_topics.gif" width="105" height="15" border="0" alt="Technical Topics" /></a></div><img src="http://developers.sun.com/im/a.gif" width="196" height="1" border="0" alt=" " /></td><td class="sunblue" width="100%" valign="top" align="right"><div class="pad10"><a href="http://www.sun.com"><img src="http://developers.sun.com/im/logo_sun.gif" width="72" height="33" border="0" alt="Sun Microsystems" /></a></div></td><td><a name="mast"></a><a href="#skip2content"><img src="http://developers.sun.com/im/a.gif" width="10" height="1" border="0" alt=" " /></a></td></tr></table></td></tr></table><span class="sp5">&nbsp;</span><br /><!-- END VNV1 MASTHEAD COMPONENT, thinner variation for content pages -->   <!-- END MASTHEAD --><!-- BEGIN BREADCRUMB --><table border="0" cellpadding="0" cellspacing="0" width="100%" class="vatop"><tr><td>      <div class="breadcrumb"><a href="http://developers.sun.com/index.html">Developers Home</a> &gt; <a href="http://developers.sun.com/prodtech/index.html">Products & Technologies</a> &gt; <a href="http://java.sun.com/index.jsp">Java Technology</a> &gt; <a href="http://java.sun.com/reference/index.html">Reference</a> &gt; <a href="http://java.sun.com/reference/docs/index.html">Documentation</a> &gt;</div></td><td align="right" nowrap="nowrap"><div class="breadcrumb"><b><a href="http://developers.sun.com/dispatcher.jsp?uid=6910021">Join a Sun Developer Network Community</a></b><br /><a href="http://developers.sun.com/user_registration/index.html">Profile and Registration</a> | <a href="http://developers.sun.com/user_registration/whyregister.html">Why Register?</a></div></td></tr><tr><td colspan="2"><img src="/im/a.gif" width="770" height="1" border="0" alt=" " /></td></tr></table><span class="sp5">&nbsp;</span><br />     <!-- END BREADCRUMB --><!-- BEGIN PAGETITLE --><div class="pagetitle2">Documentation</div><div class="pagetitle">Code Conventions for the Java Programming Language</div><!-- END PAGETITLE --><!-- BEGIN WRAPPER TABLE, 1 COLUMN, MAIN --><table border="0" cellpadding="10" cellspacing="0" width="100%"><tr><td width="100%" valign="top"><!-- BEGIN CENTRAL COLUMN COMPONENTS --><!--startindex--><!-- ============ --><!-- MAIN CONTENT --><!-- ============ --><a name="skip2content"></a><!--  BEGIN VCD4 BYLINE AND TOOLS  --><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="smaller" valign="top"><em></em></td><td width="10">&nbsp;</td><td align="right" valign="bottom"><div class="sitelinks" style="padding:0px;"><table border="0" cellpadding="0" cellspacing="0"><tr><td valign="bottom" align="right"><img src="/im/ic_print.gif" width="14" height="12" hspace="4" border="0" alt=" " /></td><td valign="bottom" class="smaller" nowrap="nowrap"><a href="/jsp_utils/PrintPage.jsp" target="popup_name" onclick="openPopup('','popup_name',655,500,'no',1,0,1,0,0,0); return true;">Printable Page</a></td></tr></table></div></td></tr></table><div class="contentdivider"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="grey4"><tr><td><img src="/im/a.gif" width="1" height="4" border="0" alt=" " /></td></tr></table></div><!--  END VCD4 BYLINE AND TOOLS  --><TABLE width="100%"><TR><TD ALIGN=LEFT COLSPAN=2><!-- page headline --><br></TD></TR></TABLE><!-- Begin Text Body --><!-- BEGIN FRAGMENT | HR TAG --><div class="contentdivider"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="grey4"><tr><td><img src="/im/a.gif" width="1" height="4" border="0" alt=" " /></td></tr></table></div><!-- END FRAGMENT | HR TAG --><P>This <em>Code Conventions for the Java Programming Language</em> document contains the standard conventions that we at Sun follow and recommend thatothers follow.  It covers filenames, file organization, indentation,comments, declarations, statements, white space, naming conventions,programming practices and includes a code example.</P>Why have code conventions? Code conventions are important to programmers for a number of reasons:<p><ul><li>80% of the lifetime cost of a piece of software goes to maintenance.<li>Hardly any software is maintained for its whole life by the original author.<li>Code conventions improve the readability of the software, allowing engineers to understand new code more quickly and thoroughly.</ul><p>The Code Conventions for the Java Programming Language document was revised and updated on April 20, 1999.</p><a href="/docs/codeconv/html/CodeConvTOC.doc.html">View HTML</a><br><a href="ftp://ftp.javasoft.com/docs/codeconv/codeconv.zip">Download HTML</a> (zip, <em>~62K</em>)<br><a href="ftp://ftp.javasoft.com/docs/codeconv/CodeConventions.pdf">Download PDF</a> (<em>~127K</em>)<br><a href="ftp://ftp.javasoft.com/docs/codeconv/CodeConventions.ps">Download PostScript</a> ( <em>~151K</em>)<br><!-- =================== --><!-- END OF MAIN CONTENT --><!-- =================== --><!--stopindex--><!-- END CENTRAL COLUMN COMPONENTS --></td></tr><!-- BEGIN SPACER ROW --><tr><td><img src="/im/a.gif" width="750" height="1" border="0" alt=" " /></td></tr><!-- END SPACER ROW --></table><!-- END WRAPPER TABLE, 1 COLUMN, MAIN --><!-- BEGIN VNV5 FOOTER  --><table border="0" cellpadding="0" cellspacing="10" width="100%"><tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%" class="vatop"><tr><td colspan="4" valign="top" class="grey3"><img src="http://developers.sun.com/im/a.gif" width="1" height="2" border="0" alt=" " /></td></tr><tr><td><img src="http://developers.sun.com/im/a.gif" width="190" height="1" border="0" alt=" " /><br /><a href="http://www.sun.com"><img src="http://developers.sun.com/im/logo_sun_small_sdn.gif" width="61" height="29" border="0" alt=" " vspace="5"/></a></td><td width="100%" valign="top"><img src="http://developers.sun.com/im/a.gif" width="350" height="1" border="0" alt=" " /><br /><div class="footer"><a href="http://developers.sun.com/dispatcher.jsp?uid=6910015">Company Info</a> &nbsp;|&nbsp;<a href="http://developers.sun.com/dispatcher.jsp?uid=6910010">About This Site</a> &nbsp;|&nbsp;<a href="http://developers.sun.com/dispatcher.jsp?uid=6910011">Press</a> &nbsp;|&nbsp;<a href="http://developers.sun.com/contact/index.jsp">Contact Us</a> &nbsp;|&nbsp;<a href="http://developers.sun.com/dispatcher.jsp?uid=6910014">Employment</a><br /><a href="http://developers.sun.com/dispatcher.jsp?uid=6910012">How to Buy</a> &nbsp;|&nbsp;<a href="http://developers.sun.com/dispatcher.jsp?uid=6910009">Licensing</a> &nbsp;|&nbsp;<a href="http://developers.sun.com/dispatcher.jsp?uid=6910013">Terms of Use</a> &nbsp;|&nbsp;<a href="http://developers.sun.com/dispatcher.jsp?uid=6910016">Privacy</a> &nbsp;|&nbsp;<a href="http://developers.sun.com/dispatcher.jsp?uid=6910017">Trademarks</a><br /><span class="sp10">&nbsp;</span><br /><br /><span class="sp10">&nbsp;</span><br />Copyright 1994-2004 Sun Microsystems, Inc.</div></td><td><img src="http://developers.sun.com/im/a.gif" width="40" height="1" border="0" alt=" " /></td><td valign="top"><div class="footer"><b><a href="http://developers.sun.com/dispatcher.jsp?uid=6910010">A Sun Developer Network Site</a></b></div><div class="footer"><img src="http://developers.sun.com/im/a.gif" width="170" height="1" border="0" alt=" " /><br />Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this <a href="http://developers.sun.com/dispatcher.jsp?uid=6910008">License</a>.<br /><span class="sp5">&nbsp;</span><br /><a href="http://developers.sun.com/dispatcher.jsp?uid=6910006"><img src="http://developers.sun.com/im/button_xml.gif" width="36" height="14" align="top" border="0" alt="XML" /></a>&nbsp;<a href="http://developers.sun.com/dispatcher.jsp?uid=6910007">Content Feeds</a></div></td></tr><tr><td colspan="4" valign="top" class="grey3"><img src="http://developers.sun.com/im/a.gif" width="1" height="2" border="0" alt=" " /></td></tr></table></td></tr></table><!-- END VNV5 FOOTER --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -