Skip to content

Commit dee7d1a

Browse files
author
Tomasz Lelek
committed
BAEL-19 iterate
1 parent 160b9ae commit dee7d1a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎kotlin/src/main/kotlin/com/baeldung/ItemService.kt‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ class ItemManager(val categoryId: String, val dbConnection: String) {
3131
fun main(args: Array<String>) {
3232
val numbers = arrayOf("first", "second", "third", "fourth")
3333

34+
var concat = ""
3435
for (n in numbers) {
35-
println(n)
36+
concat += n
3637
}
3738

38-
for (i in 0..9) {
39-
println(i)
39+
var sum = 0
40+
for (i in 2..9) {
41+
sum += i
4042
}
4143

4244
val firstName = "Tom"

0 commit comments

Comments
 (0)