Saturday 25 November 2017

Kotlin: Booleans

Boolean type is used to represent true, false states.

Booleans.kt

fun main(args: Array<String>) {

 var trueState : Boolean  = true
 var falseState : Boolean  = false

 println("Value of trueState is : ${trueState}")
 println("Value of falseState is : ${falseState}")
}

Output

Value of trueState is : true
Value of falseState is : false


Previous                                                 Next                                                 Home

No comments:

Post a Comment