Skip to content

Fix typo for ZH-CN #1307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _zh-cn/tour/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ previous-page: tour-of-scala

这是一种简单的、零设置的方法来实践Scala的代码片段。

这篇文档中的大部分代码示例与 ScalaFiddle 进行了集成,可以通过点击 “Run” 按钮即来直接运行 Scale 代码。
这篇文档中的大部分代码示例与 ScalaFiddle 进行了集成,可以通过点击 “Run” 按钮即来直接运行 Scala 代码。

## 表达式

Expand Down
2 changes: 1 addition & 1 deletion _zh-cn/tour/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ point1.y = 101 // prints the warning
```
在这个版本的`Point`类中,数据存在私有变量`_x`和`_y`中。`def x`和`def y`方法用于访问私有数据。`def x_=`和`def y_=`是为了验证和给`_x`和`_y`赋值。注意下对于setter方法的特殊语法:这个方法在getter方法的后面加上`_=`,后面跟着参数。

主构造方法中带有`val`和`var`的参数时公有的。然而由于`val`是不可变的,所以不能像下面这样去使用。
主构造方法中带有`val`和`var`的参数是公有的。然而由于`val`是不可变的,所以不能像下面这样去使用。
```
class Point(val x: Int, val y: Int)
val point = new Point(1, 2)
Expand Down
2 changes: 1 addition & 1 deletion _zh-cn/tour/unified-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ val list: List[Any] = List(
list.foreach(element => println(element))
```

这里定义了一个类型`List<Ant>`的变量`list`。这个列表里由多种类型进行初始化,但是它们都是`scala.Any`的实例,所以可以把它们加入到列表中。
这里定义了一个类型`List<Any>`的变量`list`。这个列表里由多种类型进行初始化,但是它们都是`scala.Any`的实例,所以可以把它们加入到列表中。

下面是程序的输出:

Expand Down