Skip to content

Commit d0cb6a5

Browse files
committed
Apply changes to simplified Chinese translations
1 parent b6e2e6f commit d0cb6a5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

_zh-cn/tour/basics.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,17 @@ println("Hello, " + name + "!")
167167
还有一些其他的区别,但是现在你可以认为方法就是类似于函数的东西。
168168

169169
方法也可以有多行的表达式。
170+
171+
{% scalafiddle %}
170172
```tut
171173
def getSquareString(input: Double): String = {
172174
val square = input * input
173175
square.toString
174176
}
177+
println(getSquareString(2.5)) // 6.25
175178
```
179+
{% endscalafiddle %}
180+
176181
方法体的最后一个表达式就是方法的返回值。(Scala中也有一个`return`关键字,但是很少使用)
177182

178183
##

0 commit comments

Comments
 (0)