1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-16 11:45:04 +02:00

[kotlin/all] Rename variable fooMutableDate to fooMutableData (#2688) (#2689)

This commit is contained in:
Pablo Najt
2017-03-24 14:53:41 -03:00
committed by ven
parent 29f41f2802
commit c1d773eab7
4 changed files with 12 additions and 12 deletions

View File

@@ -189,13 +189,13 @@ fun helloWorld(val name : String) {
// The "with" function is similar to the JavaScript "with" statement.
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)
/*
We can create a list using the "listOf" function.