June 2018
Intermediate to advanced
316 pages
6h 34m
English
To create ranges of variables in Kotlin, you can use the rangeTo extension function or the .. operator of Kotlin. We can create a range of any Comparable type.
Let's look at the following example:
fun main(args: Array<String>) { val int = args[0].toInt() if (int in 0..10) { println(int) }}
In this example, we retrieve a value from the args array.
To run a program with parameters in IntelliJ IDEA, click Run and choose Edit Configurations...:

In the window that opens, you can paste parameters ...
Read now
Unlock full access