kotlin is like java

Solutions on MaxInterview for kotlin is like java by the best coders in the world

showing results for - "kotlin is like java"
Stefano
17 Aug 2018
1var myVariable = 42
2myVariable = 50
3
4val myConstant = 42
5
Dora
04 Jul 2018
1val explicitDouble: Double = 70.0
2
Antonio
30 Aug 2019
1val apples = 3
2val oranges = 5
3val fruitSummary = "I have ${apples + oranges} " +
4                   "pieces of fruit."
5
Jim
04 Nov 2017
1println("Hello, world!")
2
Paolo
23 Jun 2020
1val label = "The width is "
2val width = 94
3val widthLabel = label + width
4// The width is 94
Yannick
06 Feb 2019
1// if is an expression, so ternary operation not needed
2val loaded = true
3val status = if (loaded) "Ready" else "Loading..."
4// "Ready
Alice
29 Apr 2016
1val age = 42
2
3if (age < 10) {
4    println("You're too young to watch this movie")
5} else if (age < 13) {
6    println("You can watch this movie with a parent")
7} else {
8    println("You can watch this movie")
9}
Matías
07 Apr 2019
1const val SYSTEM_DEPRECATED: String = "System is deprecated"