summaryrefslogtreecommitdiffhomepage
path: root/zh-cn/kotlin-cn.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'zh-cn/kotlin-cn.html.markdown')
-rw-r--r--zh-cn/kotlin-cn.html.markdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/zh-cn/kotlin-cn.html.markdown b/zh-cn/kotlin-cn.html.markdown
index 1fd12f5b..eb69156b 100644
--- a/zh-cn/kotlin-cn.html.markdown
+++ b/zh-cn/kotlin-cn.html.markdown
@@ -178,13 +178,13 @@ fun helloWorld(val name : String) {
// "with"函数类似于JavaScript中的"with"用法。
data class MutableDataClassExample (var x: Int, var y: Int, var z: Int)
- val fooMutableDate = MutableDataClassExample(7, 4, 9)
- with (fooMutableDate) {
+ val fooMutableData = MutableDataClassExample(7, 4, 9)
+ with (fooMutableData) {
x -= 2
y += 2
z--
}
- println(fooMutableDate) // => MutableDataClassExample(x=5, y=6, z=8)
+ println(fooMutableData) // => MutableDataClassExample(x=5, y=6, z=8)
/*
我们可以使用"listOf"函数来创建一个list。