From 2dfeff0a0e5ee3304e881fdd91dd613005cb817f Mon Sep 17 00:00:00 2001 From: LingCoder Date: Thu, 24 Jan 2019 01:43:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91=20=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/03-Objects-Everywhere.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/book/03-Objects-Everywhere.md b/book/03-Objects-Everywhere.md index 5add82e..04fc006 100644 --- a/book/03-Objects-Everywhere.md +++ b/book/03-Objects-Everywhere.md @@ -123,23 +123,28 @@ Java 的设计主要目标之一是安全性,因此许多困扰 C 和 C++ 程 ## 代码注释 -There are two types of comments in Java. The first are the traditional -C-style comment which begin with a /* and continue, possibly across -many lines, until a */. Note that many programmers begin each line -of a multiline comment with a *, so you’ll often see: + +Java 中有两种类型的注释。第一种是传统的 C 风格的注释,以 `/*` 开头,可以跨越多行,到 `*/ ` 结束。**注意**,许多程序员在多行注释的每一行开头添加 `*`,所以你经常会看到: + +```java /* This is a comment * that continues * across lines */ -Remember, however, that everything inside the /* and */ is ignored, -so there’s no difference if you say instead: +``` + +但请记住, `/*` 和 `*/` 之间的内容都是被忽略的。所以你将其改为下面的风格也是没有区别的。 + +```JAVA /* This is a comment that continues across lines */ -The second form of comment comes from C++. It is the single-line -comment, which starts with a // and continues until the end of the -line. This type of comment is convenient and commonly used because -it’s easy. So you often see: -// This is a one-line comment +``` + +第二种注释形式来自 C++ 。它是单行注释,以 `//` 开头并一直持续到行结束。这种注释方便且常用,因为它很直观和简单。所以你经常看到: + +```JAVA +// 这是单行注释 +``` ## 对象清理