Content Preview: rss
68 days ago
一、什么是注释 说起注释,得先提一提什么是元数据(metadata)。所谓元数据就是数据的数据。也就是说,元数据是描述数据的。就象数据表中的字段一样,每个字段描述了这个字段下的数据的含义。而J2SE5.0中提供的注释就是java源代码的元数据,也就是说注释是描述java源代码的。在J2SE5.0中可以自定义注释。使用时在@后面跟注释的名字。 二、J2SE5.0中预定义的注释 在J2SE5.0的java.lang包中预定义了三个注释。它们是Override、Deprecated和SuppressWarnings。下面分别解释它们的含义。 Override 这个注释的作用是标识某一个方法是否覆盖了它的父类的方法。那么为什么要标识呢?让我们来看看如果不用Override标识会发生什么事情。 假设有两个类Class1和ParentClass1,用Class1中的myMethod1方法覆盖ParentClass1中的myMethod1方法。 class ParentClass1 ... { public void myMethod1() ... {...} } class Class1 extends ParentClass1 ... { public void myMethod2() ... {...} } 建立Class1的实例,并且调用myMethod1方法 ParentClass1 c1 = new Class1(); c1.myMethod1(); ...78 days ago
1 Type is missing a javadoc commentClass 缺少类型说明 2“{” should be on the previous line “{” 应该位于前一行 3Methos is missing a javadoc comment方法前面缺少javadoc注释 4Expected @throws tag for “Exception”在注释中希望有@throws的说明 5“.” Is preceeded with whitespace “.” 前面不能有空格 6“.” Is followed by whitespace“.” 后面不能有空格 7“=” is not preceeded with whitespace“=” 前面缺少空格 8“=” is not followed with whitespace“=” 后面缺少空格 9“}” should be on the same line“}” 应该与下条语句位于同一行 10Unused @param tag for “unused”没有参数“unused”,不需注释 11Variable “CA” missing javadoc变量“CA”缺少javadoc注释 12Line longer than 80characters行长度超过80 13Line contains a tab character行含有”tab” 字符 14Redundant “Public” modifier冗余的“public” modifier 15Final modifier out of order with the JSL suggestionFinal modifier的顺序错误 16Avoid using the “.*” form of importImport格式避免使用“.*” 17Redundant import from the same ...
153 days ago
朱棣文在哈佛大学毕业典礼上的演讲 演说日期:2009年6月4日 译者:阮一峰 原文网址:http://www.news.harvard.edu/gazette/2009/06.04/chu_speech.html 在线观看:http://vimeo.com/5007822 音频下载:http://harvardmag.com/media/2009-commencement-day-chu.mp3 (17.5MB) 【演讲人介绍】 朱棣文(Steven Chu,1948年2月28日-), 美国物理学家,生于美国圣路易斯;华人血统,祖籍中国江苏太仓,曾获得诺贝尔物理学奖(1997年)。现任美国能源部部长。 1970年,获罗彻斯特大学数学学士和物理学学士。 1976年,获加州大学伯克利分校物理学博士。 1987年,任斯坦福大学物理学教授,是该校第一位华裔教授。 1993年,当选美国国家科学院院士。 1997年,获诺贝尔物理学奖。 2004年,任劳伦斯·伯克利国家实验室主任,是首位掌管这个美国能源部下属国家实验室的亚裔人士。 2009年,出任奥巴马政府能源部长。 【正文】 Madam President Faust, members of the Harvard Corporation and the Board of Overseers, faculty, family, friends, and, most importantly, today’s graduates, 尊敬的Faust校长,哈佛集团的各位成员,监管理事会的各位理事,各位老师,各位家长,各位朋友,以及最重要的各位毕业生同学, Thank you for letting me share this wonderful day with you. 感谢你们,让我有机会同你们一起分享这个美妙的日子。 I am not sure I can live up to the high standards of Harvard Commencement speakers. Last year, J.K. Rowling, the billionaire novelist, who started as a ...



