6
val myBoolean = false & true 

gives a compilation error in Kotlin (Unexpected tokens (use ';' to separate expressions on the same line))

2

1 Answer 1

5

The "operator" you are looking for is the infix and function in Kotlin (reference page: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/and.html)
Therefore your example should be

val myBoolean = false and true 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.