From faa3d322f8868b8af7eb1d0c143acbfc796efa90 Mon Sep 17 00:00:00 2001 From: Tomasz Lelek Date: Tue, 17 Jan 2017 16:25:19 +0100 Subject: [PATCH] BAEL-382 creating mutalbe and immutable list --- kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt b/kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt index 1740fb2863..96e297115b 100644 --- a/kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt +++ b/kotlin/src/main/kotlin/com/baeldung/kotlin/ItemService.kt @@ -30,6 +30,7 @@ class ItemManager(val categoryId: String, val dbConnection: String) { fun sum(a: Int, b: Int): Int { return a + b } + } fun main(args: Array) { @@ -39,7 +40,6 @@ fun main(args: Array) { println(n) } - for (i in 2..9 step 2) { println(i) } @@ -71,4 +71,9 @@ fun main(args: Array) { "Alice" -> println("Hi lady") } + val items = listOf(1, 2, 3, 4) + + + val rwList = mutableListOf(1, 2, 3) + rwList.add(5) } \ No newline at end of file