Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Kotlin equivalent for bitwise or with assignment '|='?

How to write in Kotlin:

flags |= newFlag 

Only what I have found is:

flags = flags or newFlag 

Is there a build-in bitwise or operator with assignment?

like image 582
TN. Avatar asked May 13 '14 15:05

TN.


People also ask

What does it mean by assignment operator in Kotlin?

Kotlin Assignment Operators Assignment operators are used to assign values to variables.

What does ?: Means in Kotlin?

This operator is also known as "not-null assertion operator". This operator is used to convert any value to a non-NULL type value and it throws an exception if the corresponding value is NULL.

What are Kotlin logical operators?

Logical Operators Note that, or and and are functions that support infix notation. Logical operators are used in control flow such as if expression, when expression, and loops.


1 Answers

There is no built in bitwise-or assignment operator in Kotlin (yet).

like image 95
Jesan Fafon Avatar answered Oct 08 '22 04:10

Jesan Fafon