Scala - Boolean Literals (true and false) Code Example

The code for Boolean Literals (true and false)

// In Scala, The Boolean literals are used with Boolean.
// They are of two types: true and false.
// Example to demonstrate the assign and access Boolean literals

val x: Boolean = true
val y: Boolean = false

// Print the values
println(x)
println(y)

/*
Output:
true
false
*/
Code by IncludeHelp, on August 10, 2022 22:05

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.