In Kotlin, can every expression (theoretically) be...
# getting-started
f
In Kotlin, can every expression (theoretically) be used as a standalone statement? Java doesn't allow putting 1 + 1; into a line but in Kotlin that works
d
Yes! Almost everything is an expression except
=
.
f
Thanks, but what I actually mean is can every expression be a statement
it looks so to me
In Java you can't just put 1 + 1; into its own line but in Kotlin this is possible (altough useles)
d
I was trying to say that the things you probably think are statements are expressions.
But the answer is Yes.
f
thanks