- 1、本文档共16页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
《Google Java Style》.pdf
go o gle -st y le guide .go o gle co de .co m http://go o gle-styleguide.go o gleco de.co m/svn/trunk/j avaguide.html
Google Java Style
1 Int roduct ion
T his do cument serves as t he complet e def init io n of Googles coding st andards f o r so urce code in t he
Java ™ rogramming Language. A Java so urce f ile is described as being in Google Style if and o nly if it adheres
t o t he rules herein.
Like ot her programming style guides , t he iss ues covered s pan not o nly aest het ic iss ues of f o rmatt ing, but
ot her types of co nvent io ns o r coding st andards as well. However, t his do cument f o cuses primarily o n t he
hard-and-f ast rules t hat we f o llow universally, and avo ids giving advice t hat is nt clearly enf o rceable (whet her
by human o r t oo l).
1.1 Te rminology not es
In t his do cument , unless ot herwise clarif ied:
1. T he t erm class is used inclus ively t o mean an o rdinary class , enum class , int erf ace o r annot at io n type (
@int erf ace).
2. T he t erm comment always ref ers t o implementation co mment s . We do not use t he phrase
do cument at io n co mment s, inst ead us ing t he co mmo n t erm Javado c.
Ot her t ermino logy not es will appear o ccas io nally t hro ugho ut t he do cument .
1.2 Guide not es
Example code in t his do cument is non- normat ive . T hat is , while t he examples are in Google Style, t hey
may not illust rat e t he only stylis h way t o represent t he code. Opt io nal f o rmatt ing cho ices made in examples
s ho uld not be enf o rced as rules .
2 Source f ile basics
2.1 File name
T he so urce f ile name co ns ist s of t he case- sens it ive name of t he t o p- level class it co nt ains , plus t he
.java ext ens io n (as ide f ro m package- inf o.java f iles ).
2.2 File e ncoding UT F-8
So urce f iles are encoded in UT F-8.
2.3 Special charact e rs
2.3.1 Whit espace charact e rs
As ide f ro m t he line t ermina
您可能关注的文档
- 《GB50395-二零一六《视频安防监控系统工程设计规范》》.pdf
- 《GBT 19001-二零一六 质量管理体系 要求》.pdf
- 《GBT 19004-二零一六质量管理体系 业绩改进指南》.pdf
- 《GBT 19017-二零一六 质量管理体系_技术状态管理指南》.pdf
- 《GBT 20270-二零一六 信息安全技术网络基础安全技术要求》.pdf
- 《GBT 20280-二零一六 信息安全管理体系 要求》.pdf
- 《GBT 20520-二零一六 信息安全技术 公钥基础设施 时间戳规范》.pdf
- 《GBT 20661-二零一六 石油和天然气工业 用于海底和海洋立管的挠性管系统》.pdf
- 《GBT 22081-二零一六 信息安全管理实用规则》.pdf
- 《GBT 2820.5-二零一六 往复式内燃机驱动的交流发电机组 第5部分:发电机组》.pdf
文档评论(0)