We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

[CG]Nick • 9 months ago

Hi,

I think that there are missing comas in code, so it does not compile :/

romainbsl • 9 months ago

Hi,

Thx :)

I just fixed it !

Anonymous • 2 months ago

Sealed class snippet code doesn't run!

lestephane1 • 5 months ago

In the infix notation code example i think there is a typo on line 5
println(1.add(1))
should be
println(1 add 1)
should it not?

C_Winikka • 7 months ago

I have another: what (if any) is the difference between val and var?

C_Winikka • 7 months ago

Three things:
1. Thanks. This page kept me busy awhile just pondering the nuances of Kotlin at a glance.
2. Is a list mutable? In other words, can you change animals at index position 0 to a different animal without causing an error? For example, in Python lists are mutable, so you can change an item by accessing it's index position. For example, in Python,
animals[0] = "weasel"
changes the first item in animals from "dog" to "weasel." I tried it that way in Kotlin above, but it ran an error. That seems to suggest it's immutable, but it could just be that my syntax doesn't work in Kotlin, and there's some kind of list method that lets us do just that.
3. There were a few typos: aniamls instead of animals and convinient instead of convenient

MadKnight • 9 months ago

a small typo:
> In Kotlin, IF becomes an expression, that means that it cans return values

matt2xu • 9 months ago

Just a small typo: the withIndex() example seems to be backwards, for me it prints "animal at dog is 0" etc when I expected it to be the other way around (animal at 0 is dog). Otherwise it's nice to see an overview of Kotlin like this :)