Kotlin Statement
Jump to navigation
Jump to search
A Kotlin Statement is a Kotlin code item that is a software expression.
- Context:
- It can (typically) be an Imperative Program Expression.
- ...
- Example(s):
// a one-line comment
2 * 3.45 + 6
, a Mathematical Operation.println("Result=${2 * 3.45 + 6}")
, an STDOUT Print Statement.val engToDeu = mapOf("dog" to "Hund", "cat" to "Katze", "rhinoceros" to "Nashorn")
, a Kotlin Map variable definition statement.var x = 0; do { println(x); x += 1 } while (x < 5)
, a Loop Statement.fun f(x: Any) = println(x)
, a Function Definition Statement with anonymous type.fun intRoot23(num: Int): Int {
val numSquare = num * num
return (Math.cbrt(numSquare.toDouble()) + Math.log(numSquare.toDouble())).toInt() }- ...
- Counter-Example(s):
- See: Kotlin Source Code, Kotlin Program.